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

Link to comment
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());

 

thanks, turns out the password field was user_password. thanks for the tip

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.