RE: [PHP-DB] Interbase: Number recs
| From: | Cosenza, Mario | Date: | Mon, 02 Oct 2000 17:36:30 +0000 |
| Subject: | RE: [PHP-DB] Interbase: Number recs | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3224@lists.php.net to get a copy of this message | ||
I haven't checked the results in php, but you could execute a 'count' query.
SELECT count(*) FROM PHOTOS;
(I'm also using MySQL)
Hope it Helps,
Mario
-----Original Message-----
From: Todd Cary [mailto:todd@aristesoftware.com]
Sent: Monday, October 02, 2000 1:21 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Interbase: Number recs
Is there an easier way to get the number of records from a SELECT?
+++
$stmt = 'SELECT PH_CD,PH_ROLL,PH_FRAME_LABEL,PH_ID FROM PHOTOS';
$sth = ibase_query($stmt,$dbh);
$ct = 0;
while ($row = ibase_fetch_row($sth)) {
++$ct;
};
$totalrecs = $ct;
+++
What is the method to go to the first record?
Todd
--
Todd Cary
Ariste Software
todd@aristesoftware.com