Re: PDO user question
| From: | Michael Stowe | Date: | Sun, 09 Sep 2012 16:49:20 +0000 |
| Subject: | Re: PDO user question | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48469@lists.php.net to get a copy of this message | ||
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.wixfort@gmx.de> wrote:
> 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 (depending upon driver?) and there were a
>> couple of solutions that made no sense to me. There was even one that
>> did a completely separate query just to get the row count which makes
>> even less sense.
>
> I believe you are referring to "SELECT COUNT(*)..."
> Because I couldn't find a different way I use that.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>