Jump to content

HELP!! Warning: mysql_num_rows(): supplied argument is not a valid MySQL result


Recommended Posts

some please help - basically have a simple password change php page

 

$sql="UPDATE t_members SET Password = '$New_Password' WHERE Username = '$My_Username' AND  Password = '$Old_Password'";

 

echo $sql;

 

$result=mysql_query($sql) or die(mysql_error());

$firstcount = mysql_num_rows($result);

 

and i get this annoying error Warning: mysql_num_rows(): supplied argument is not a valid

 

the sql statement works as i see it updating the database correctly

My bad - mysql_num_rows won't work with UPDATE - missed that first time round.

 

http://php.net/manual/en/function.mysql-num-rows.php

 

This command is only valid for statements like SELECT or SHOW that return an actual result set.
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.