Help with Mysql Select 2 tables
Posted: Wed Apr 11, 2012 9:19 pm
Hey Guys,
Hey Guys,
After searching on google and other forums for solutions for this warning im still having trouble as to why it wont identify if an email already exsists in either of the 2 tables (managers, players).
Warning: mysql_result() expects parameter 1 to be resource, boolean given in /Users/Tim/Sites/DMS/RoutoSMS/functions.php on line 71
This is the code where it identifies the function:
Hey Guys,
After searching on google and other forums for solutions for this warning im still having trouble as to why it wont identify if an email already exsists in either of the 2 tables (managers, players).
Warning: mysql_result() expects parameter 1 to be resource, boolean given in /Users/Tim/Sites/DMS/RoutoSMS/functions.php on line 71
Code: Select all
function emailExists($email) {
$query = mysql_query("SELECT `managers`.`email`, `players`.`email` FROM `managers`, `players` WHERE `email` = '$email'");
return (mysql_result($query, 0) > 0) ? true : false ;
}
This is the code where it identifies the function:
Code: Select all
if(emailExists($email)) {
$errors[] = "Email already registered.";
}