I am new to PHP and I have been following a tutorial on how to build a login and registration form. Can someone help me figure out what is wrong with this line of code.
function user_active($username) {
$username = sanitize($username);
return (mysql_result(mysql_query(“SELECT * FROM user WHERE username =’$username’ AND active = 1”), 0) == 1) ? true : false;
}
This is the error I am getting: ( I am using dreamweaver)
( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 15 in C:\wamp\www\Template\core\functions\users.php on line 31
Call Stack
Time Memory Function Location
1 0.0020 261736 {main}( ) …\register.php:0
2 0.0250 295280 user_exists( ) …\register.php:30
3 0.0256 298680 mysql_result ( ) …\users.php:31
I am clearly not decent enough to trace the pathing error so any suggestions would be awesome.