Error on mysql_num_rows

From: Date: Thu, 20 Mar 2003 12:44:33 +0000
Subject: Error on mysql_num_rows
Groups: php.general 
Request: Send a blank email to php-general+get-140419@lists.php.net to get a copy of this message
I've been trying to count records that match my query in MySQL using the examples given in the on-line manual as well as the user comments and I'm still getting the error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource. Here's the code. mysql_connect ($local_host, $local_user, $local_pass); mysql_select_db ($local_db); $result = mysql_query ("SELECT count(id) FROM listings WHERE agent = '$agent' AND child = '0'"); $rc = mysql_num_rows($result); mysql_close(); Is there something I'm missing here? I've tried using just about every example in the on-line manual and get the same error. I can run other queries just fine though. Thanks, Ed

« previous php.general (#140419) next »