note 77984 added to ref.pdo-mysql
| From: | bratwizard at yahoo dot com | Date: | Sat, 22 Sep 2007 19:59:47 +0000 |
| Subject: | note 77984 added to ref.pdo-mysql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130694@lists.php.net to get a copy of this message | ||
> 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);
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 72.86.32.56
----
Manual Page -- http://www.php.net/manual/en/ref.pdo-mysql.php
Edit -- https://master.php.net/note/edit/77984
Del: integrated -- https://master.php.net/note/delete/77984/integrated
Del: useless -- https://master.php.net/note/delete/77984/useless
Del: bad code -- https://master.php.net/note/delete/77984/bad+code
Del: spam -- https://master.php.net/note/delete/77984/spam
Del: non-english -- https://master.php.net/note/delete/77984/non-english
Del: in docs -- https://master.php.net/note/delete/77984/in+docs
Del: other reasons-- https://master.php.net/note/delete/77984
Reject -- https://master.php.net/note/reject/77984
Search -- https://master.php.net/manage/user-notes.php