Req #9218 [Com]: can ibase_num_rows be implemented?
| From: | oliverhdzrangel at gmail dot com | Date: | Wed, 27 Jun 2012 14:54:32 +0000 |
| Subject: | Req #9218 [Com]: can ibase_num_rows be implemented? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-171577@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=9218&edit=1
ID: 9218
Comment by: oliverhdzrangel at gmail dot com
Reported by: blib at mail dot com
Summary: can ibase_num_rows be implemented?
Status: Closed
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: N/A
PHP Version: 4.0.4pl1
Block user comment: N
Private report: N
New Comment:
From the Firebird FAQ
----------------------
How to get record count for any query without executing it?
Sometimes you just want to see how many records would some query produce, without actually fetching
them all. With Firebird 2 and derived tables it's quite easy:
SELECT COUNT(*) FROM ( your select query );
For example:
SELECT COUNT(*) FROM ( select * from employee where emp_no > 8 );
In earlier versions (1.x) of Firebird you should either rewrite the query to get the record count,
or create a view and do SELECT COUNT(*) from it. For example:
create view my_employees as select * from employee where emp_no > 8;
commit;
SELECT COUNT(*) FROM my_employees;
commit;
drop view my_employees;
Previous Comments:
------------------------------------------------------------------------
[2001-02-11 17:05:01] jah@php.net
No chance. InterBase just doesn't return the number of
records in recordset, so there's no way to implement it
without actually fetching all the rows (which is not going
to happen in the extension level). You might consider
writing a wrapper in PHP and storing the results temporarily
into an array, if you can't live without this feature.
------------------------------------------------------------------------
[2001-02-11 16:41:19] derick@php.net
Feature request, not a bug
------------------------------------------------------------------------
[2001-02-11 16:26:11] blib at mail dot com
Is there any chance that ibase_num_rows would be implemented? Or some other function that will let
you know number of rows returned by query.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=9218&edit=1