acctman Posted October 7, 2007 Share Posted October 7, 2007 i'm receiving this error when I try to fetch the query row. error: [07-Oct-2007 14:39:57] PHP Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/rmsite/public_html/includes/dologin.php on line 96 $query = "SELECT user_id FROM psite_users WHERE username='$username' AND password='" . md5($password) . "'"; $result = mysql_query($query); // line 96 $line = mysql_fetch_row($result); $uid = $line["user_id"]; if(!$uid){ ... Quote Link to comment https://forums.phpfreaks.com/topic/72213-solved-phpmysql-fetch-row-error/ Share on other sites More sharing options...
Rithiur Posted October 7, 2007 Share Posted October 7, 2007 The error occurs, because the MySQL query failed previously. Make sure that the field and table names you entered are correct in the SQL statement and that there are no other errors in the query. To see the actual MySQL error that occured, you may use something like this for debugging purposes: $result = mysql_query($query) or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/72213-solved-phpmysql-fetch-row-error/#findComment-364127 Share on other sites More sharing options...
acctman Posted October 7, 2007 Author Share Posted October 7, 2007 The error occurs, because the MySQL query failed previously. Make sure that the field and table names you entered are correct in the SQL statement and that there are no other errors in the query. To see the actual MySQL error that occured, you may use something like this for debugging purposes: $result = mysql_query($query) or die(mysql_error()); thanks, turns out the password field was user_password. thanks for the tip Quote Link to comment https://forums.phpfreaks.com/topic/72213-solved-phpmysql-fetch-row-error/#findComment-364136 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.