note 86390 modified in function.mysql-num-rows by danbrown

From: Date: Thu, 16 Oct 2008 13:16:09 +0000
Subject: note 86390 modified in function.mysql-num-rows by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-145408@lists.php.net to get a copy of this message
here is a working get rows function, it always gets the right result <?php function get_rows ($table_and_query) { $total = mysql_query("SELECT COUNT(*) FROM $table_and_query"); $total = mysql_fetch_array($total); return $total[0]; } ?> this is one that worked for me :-) --was-- here is a working get rows function, it always gets the right result function get_rows ($table_and_query) { $total = mysql_query("SELECT COUNT(*) FROM $table_and_query"); $total = mysql_fetch_array($total); return $total[0]; } this is one that worked for me :-) http://php.net/manual/en/function.mysql-num-rows.php

« previous php.notes (#145408) next »