note 11279 added to mysql_result

From: Date: Wed, 14 Feb 2001 06:43:55 +0000
Subject: note 11279 added to mysql_result
Groups: php.notes 
Request: Send a blank email to php-notes+get-11034@lists.php.net to get a copy of this message
There is another way to find out the number of rows of a table without using mysql_result. Try this: mysql_select_db("my_db"); $query = "SELECT my_field FROM my_table"; $result = mysql_query($query); $rows = mysql_num_rows($result); echo "Rows: $rows"; A similar approach works for PostgreSQL. So, I presume it´s also valid for MySQL. Hope it helps. http://www.php.net/manual/en/function.mysql-result.php

« previous php.notes (#11034) next »