[development] PDO and database limitations

Dries Buytaert dries.buytaert at gmail.com
Wed Apr 4 19:33:49 UTC 2007


On 04 Apr 2007, at 08:05, Larry Garfield wrote:

> A) Stop using db_num_rows() on result sets.  (It's a database- 
> specific feature
> in the first place.)  In places where we use it, use a separate  
> count(*)
> query instead.  That's the more database-agnostic method, and is  
> what the PHP
> manual recommends[3].  If we go this route, it will involve  
> removing the
> db_num_rows() function from the existing mysql and postgres drivers  
> and
> refactoring core queries accordingly.

I'd go for A.  :)

If we don't need the exact count, we might be able to replace  
db_num_rows() with something like db_table_is_empty().

Let us know if you run into issues that need further attention/ 
discussion.

--
Dries Buytaert  ::  http://www.buytaert.net/



More information about the development mailing list