Re: Re: RE: [PEAR-DEV] numRows(), out of order

From: Date: Mon, 21 Jul 2003 17:18:09 +0000
Subject: Re: Re: RE: [PEAR-DEV] numRows(), out of order
References: 1 2 3 4  Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-18497@lists.php.net to get a copy of this message
Hi, Hans Lellelid wrote:
Yeah if all you are concerned with is the number of rows then use COUNT(*).
Perhaps you could re-implement numRows() to do this, and add a big warning about performance, or is the goal to cut off bloat?
I think that it would be difficult to do this in a generic enough way at the MDB level. I've had trouble w/ using COUNT() on more complex queries -- especially where DISTINCT keyword, or other SELECT clause functions are involved. MySQL is generally very forgiving, but other RDBMS backends (e.g. SQL Server) tend to be pickier. Maybe there is a surefire regex way to get a COUNT() query for *any* SQL, in which case, this might be a good solution. I know, however, that ADOdb has had a history of some buggy behavior in the pagination code that did the COUNT() query rewrites.
With this information, I retract my suggestion :). Scrap numRows() Greg

« previous php.pear.dev (#18497) next »