I'm having trouble with the Register an Login tutorial part 4(actualy the error is in user.inc.php), when I try to register with empty fields I get an error(I've been trying to solve it for an hour):
Warning: mysql_result(): supplied argument is not a valid MySQL result resource
code:
function user_exists($user){
$user = mysql_real_escape_string($user);
$total = mysql_query("SELECT COUNT('user_id') FROM 'Accounts' WHERE 'user_name' = '{$user}'");
return (mysql_result($total, 0) == '1') ? true : false;
}
Help would be appreciated.