note 31553 added to function.mysql-num-rows

From: Date: Fri, 25 Apr 2003 18:33:47 +0000
Subject: note 31553 added to function.mysql-num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-47092@lists.php.net to get a copy of this message
$count_product_type_results = mysql_query( $sql_product_type_count ); Why is this line not returning the result from "SELECT COUNT(*) ..." query? My guess is that the correct line would be: $count_product_type_results = mysql_result(mysql_query( $sql_product_type_count ),0); You forgot to call mysql_fetch_array() or mysql_result() or any function that returns actual row or column and you are printing variable that is comonly named as $result which is of resource type. If you are experienced C++ programer, you could think of it as a "pointer" or "reference" to the whole resultset. You might want to try var_dump($count_product_type_results)... -- http://www.php.net/manual/en/function.mysql-num-rows.php http://master.php.net/manage/user-notes.php?action=edit+31553 http://master.php.net/manage/user-notes.php?action=delete+31553 http://master.php.net/manage/user-notes.php?action=reject+31553

« previous php.notes (#47092) next »