note 18794 deleted from function.mysql-fetch-row by philip
| From: | philip@php.net | Date: | Mon, 26 Feb 2007 06:57:06 +0000 |
| Subject: | note 18794 deleted from function.mysql-fetch-row by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123877@lists.php.net to get a copy of this message | ||
Note Submitter: doubREDHATtme at hotmail dot comNODISTRO
----
This took me a few minutes to suss out, so I thought I'd share it:
If your doing a select count(*) statement, the simplest syntax I have come up with to actually get
access to the value is:
// stores the result in an array:
$count = mysql_fetch_array(mysql_query($query_string, $db));
// the actual count is stored in the first index (0):
print("row count: $count[0]");
NB I've ignored error checking here :)
Christo Fogelberg