note 11279 deleted from function.mysql-result by didou
| From: | didou@php.net | Date: | Sat, 17 May 2003 21:35:02 +0000 |
| Subject: | note 11279 deleted from function.mysql-result by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48281@lists.php.net to get a copy of this message | ||
Note Submitter: sellaro <at> lia <dot> ufc <dot> br
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.