I am trying to query 3 tables but it is returning an error. I want the code to check the 3 tables whether the user is registered in one of these tables if he tries to log in. Please help me I'm just a php beginner.
I get the following error:
Warning: mysql_result() expects parameter 1 to be resource, boolean given in
This is my code:
//check user if exist
function user_exists($username){
$username = sanitize($username);
return (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM
`users`,`admin`,`guest` WHERE `username` = '$username'"), 0) == 1) ? true : false;