Rainer Collet wrote:
hi!
i tested several php database abstraction layers (db, mdb(2), creole,
adodb, etc), but i always missed one really important feature:
i need a method for a limited select which gives me the resultset and
the total number of rows the select would have returned without the
limit.
nativly this is very easy
SELECT SQL_CALC_FOUND ROWS * FROM table LIMIT 0,10 in mysql for
example.
does anybody know an abstraction layer which supports this?
thanks,
rainer
How hard would it be to hack this in yourself? If you are dealing with an
abstraction layer, it must be constructing the SQL, and so it should be
possible to take a form of the SQL w/o the LIMIT clause and then use
db-specific *_num_rows() function.
This does leave open the whole question of whether or not such things are
good practice in terms of performance, but laying that aside it should be
easy enough to add.
--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)