Re: mysql_num_rows() <-- works but sometimes gives error?
| From: | Jason Wong | Date: | Wed, 23 Jan 2002 05:05:19 +0000 |
| Subject: | Re: mysql_num_rows() <-- works but sometimes gives error? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81638@lists.php.net to get a copy of this message | ||
On Wednesday 23 January 2002 12:44, Phil Schwarzmann wrote:
> When I use the function "mysql_num_rows()" it will work just fine except
> that SOMETIMES I get this error message...
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /blahblah/patient/afterpassword.php on line 67
This error occurs most likely because your query ($query) is invalid.
> Here is the code...
>
> 65 $query = "UPDATE users set password='$newpassword' WHERE username =
> '$user'";
> 66 $result = mysql_query($query);
> 67 $num_results = mysql_num_rows($result);
>
> what am I doing wrong here??
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Fools ignore complexity. Pragmatists suffer it.
Some can avoid it. Geniuses remove it.
-- Perlis's Programming Proverb #58, SIGPLAN Notices, Sept. 1982
*/