Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Functions\Users.php on line 5
This is the code which the error is appearing from but I can't work out what is going wrong.
- Code: Select all
<?php
function user_exists($username) {
$username = sanitize($username);
$query = mysql_query("SELECT COUNT('user_id') FROM 'users' WHERE 'username' = '$username'");
return (mysql_result($query, 0) == 1) ? true : false;
}
?>
Thanks in advance