Re: [PHP-DB] PDO user question

2012-09-10 Thread Matt Pelmear
Brandon: RAM is cheap, but not always expendable depending on what you're doing. Using count() on results from PDOStatement::fetchAll() is fine on small result sets. Keep in mind that this will certainly blow up on very large result sets, especially depending on your memory_limit for php. Avoidi

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 of

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 2012-

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 wrote: > Hi Jim > >> I've had some success with querying using pdo and prepared s

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 (dep

[PHP-DB] PDO user question

2012-09-08 Thread Jim Giner
I finally delved into learning how I was going to replace my MYSQL calls with a different interface. Had to go with PDO since my hoster doesn't support MYSQLI for my plan. I've had some success with querying using pdo and prepared statements as well. One thing that I'm curious about is How