It's very simple question but am not getting the right syntax -
Basically - i have a table with the column for ids.
Now when user enters that id in the form - i want that entered id to be matched against all the ids available in that table in database -
Code: Select all
mysql_select_db($db,$link);
$query = "select xid from test";
$result = mysql_query($query, $link) or die(mysql_error());
$row = mysql_fetch_array($result);
foreach ($row as $val)
{
if($val == $CustomerEnteredID)
{
// DO THIS
}
else
{
echo "not found";
}
}
I know it's something simple am missing - can anyone please shed some light on it.
Thanks