I have a database search. $search comes from post data, as does $type. Whenever I have it echo the number after it does the query, it returns 1, but for some reason it tells me I have no matches. Does anyone have any ideas on what may be going on with this?
if ($type == "E-mail Address"){
$sql = "SELECT * FROM user_driver WHERE driver_email = '$search'";
$result = mysql_query($sql) or die ("#1 err.");
$num = mysql_num_rows($result);
echo($num);
if ($num == 0) // no matches
{
echo ("Sorry, no matches!");
}
elseif ($num > 0) // login name not found
{
unset($do);
$message = "Found matches";
include ("search_form.inc");
}
}
Thanks in advance,
Aimee
if ($type == "E-mail Address"){
$sql = "SELECT * FROM user_driver WHERE driver_email = '$search'";
$result = mysql_query($sql) or die ("#1 err.");
$num = mysql_num_rows($result);
echo($num);
if ($num == 0) // no matches
{
echo ("Sorry, no matches!");
}
elseif ($num > 0) // login name not found
{
unset($do);
$message = "Found matches";
include ("search_form.inc");
}
}
Thanks in advance,
Aimee