Re: [PHP-DB] PDO user question

2012-09-09 Thread Stefan Wixfort
Hi Jim I've had some success with querying using pdo and prepared statements as well. One thing that I'm curious about is How does one handle the need to get the number of rows returned by a Select? The documentation is very clear that PDO doesn't return that value for a Select statement

Re: [PHP-DB] PDO user question

2012-09-09 Thread Michael Stowe
How are you using the number? Probably the easiest way is to utilize PDOStatement::FetchAll() and then do a count() on that result set. - Mike Sent from my iPhone On Sep 9, 2012, at 11:42 AM, Stefan Wixfort stefan.wixf...@gmx.de wrote: Hi Jim I've had some success with querying using

Re: [PHP-DB] PDO user question

2012-09-09 Thread brandon
That's how I'd do it. Extend the PDO interface on your abstract class to include a num_rows() method that utilizes that higher level count($this-result). It might be a little more overhead... but RAM is cheap... and there's always forking/extending the library in C/C++... -Brandon On

Re: [PHP-DB] PDO user question

2012-09-09 Thread Lester Caine
Michael Stowe wrote: How are you using the number? Probably the easiest way is to utilize PDOStatement::FetchAll() and then do a count() on that result set. There are two things to bear in mind here. Often you are only displaying a subset of records - ten per page perhaps - and so a count