note 50694 rejected from function.mysql-num-rows by nlopess

From: Date: Mon, 07 Mar 2005 17:07:32 +0000
Subject: note 50694 rejected from function.mysql-num-rows by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-86059@lists.php.net to get a copy of this message
Note Submitter: bill082167 at yahoo dot com ---- Is there some limit to the number of times you can use sql_num_rows, or is there some way you need to reset this value between sql statements? I seem to be able to use it once, but when I try to use it again on another table using exactly the same syntax, it fails. //Total User Count $countusers = "SELECT * FROM Users"; $users = mysql_query($countusers); $count_users = mysql_num_rows($users); //Total Survey Count $countsurveys = "SELECT * FROM Survey1"; $surveys = mysql_query($countsurveys); $count_surveys = mysql_num_rows($surveys); The first one runs OK and returns the correct result, but the next one (and all subsequent ones) returns the following: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

« previous php.notes (#86059) next »