Jump to content

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


haighster

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.

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.