note 77984 deleted from ref.pdo-mysql by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:42:51 +0000 |
| Subject: | note 77984 deleted from ref.pdo-mysql by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196608@lists.php.net to get a copy of this message | ||
Note Submitter: bratwizard at yahoo dot com
----
> konrads dot smelkovs at gmail dot com
> 18-Jul-2007 03:39
> A note for the eager:
>> There is no way how to get returned row count from an executed prepared statement without
>> fetching the rows.
Sure there is, just do something like this:
if ($sth = $pdo->prepare($sql)) {
$sth->execute($values);
$sth->fetch();
// get count of rows in result set
if ($sth_rc = $this->getDataset()->query('SELECT FOUND_ROWS()')) {
$row_count = $sth_rc->fetchColumn(0);
}
}