note 9212 added to mysql_num_rows
| From: | crubel at trilizio dot org | Date: | Mon, 23 Oct 2000 05:08:29 +0000 |
| Subject: | note 9212 added to mysql_num_rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6862@lists.php.net to get a copy of this message | ||
For those of you who are like me you might forget to select the database. Took me a half an hour
just to figure that out so here is an example of what I've come up with.
-- IE: If you wanted total members of a message board --
$conn = mysql_connect("hostaddress", "username", "password");
mysql_select_db("database",$conn);
$Resultfornummembers = mysql_query("SELECT * FROM Accounts",$conn);
$NumMembers = mysql_numrows($Resultfornummembers);
echo "$NumMembers Members";
http://www.php.net/manual/function.mysql-num-rows.php