$pull = $DB->query("SELECT * FROM table WHERE id > 0", __FILE__, __LINE__); $count = $DB->num_rows($pull); is that the fastest way to count rows and get the value to a var?
How would I get it to a var? var_dump returns this resource(22) of type (mysql result) resource(26) of type (mysql result) resource(30) of type (mysql result) resource(34) of type (mysql result) resource(38) of type (mysql result)
$sql = "SELECT count(*) FROM table"; $query = mysql_query($sql); list($rows) = mysql_fetch_row($query) Code (markup): You'll have the count in $rows
or... <?php $sql = mysql_query("SELECT * FROM table"); $num = mysql_num_rows($sql); echo $num. "Rows"; ?> PHP: