Jump to content

[SOLVED] Php/Mysql fetch row() error


acctman

Recommended Posts

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){ ...

 

 

Link to comment
https://forums.phpfreaks.com/topic/72213-solved-phpmysql-fetch-row-error/
Share on other sites

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());

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.