I have the following code:
<?php
$code = $_POST['code']; // textbox
$con = mysql_connect("***","****","****");
if (!$con)
{
die('Server overload, please try again' . mysql_error());
}
mysql_select_db("example", $con);
$sql = mysql_query("SELECT code FROM exampletable");
while ($version = mysql_fetch_array($sql))
{
// do something
}
mysql_close($con);
?>
What I want this code to do is check the value of an textbox then search the column code in my MySQL database to look for any matches. If there are any matches I would like it to check the column known as 'version' and if 'version' is equal to 1 then execute another piece of code.
I'm pretty new to MySQL and the MySQL/Database side of PHP so I know this will probably be an easy question for most of you to answer, so could anyone offer guidance?
Thanks,
Lawrence