Hi, as a newb, im having a real problem with the following query:
I need to check wether a value exists in a table, and if it does then do something else do something else.
I know the value does exist in the dirNAME column, and have checked this with a mysql admin tool, but the mysql_num_rows\90 keeps returning "0".
Can anyone see anything wrong with the Query syntax, especially the variable name part?
//PERFORM SELECT QUERY
$result = @mysql_query("SELECT dirNAME FROM customers WHERE dirNAME = '.$jclogin.'");
if (!$result)
{
die('<p>Error performing query: '.mysql_error().'</p>');
}
$dirExists = mysql_num_rows($result); # result num rows handle
echo "$dirExists Rows\n";
if (!$dirExists)
{ $_SESSION['orderSTATUS'] = "no";
echo "need to register";
//header("Location: Register.php"); //go to Register Page
}
else
{ $_SESSION['orderSTATUS'] = "yes";
echo "go to contact sheet";
//header("Location: Contactsheet.php"); //go to ContactSheet
}
Thanks