note 104930 added to pdostatement.rowcount

From: Date: Sat, 16 Jul 2011 19:08:41 +0000
Subject: note 104930 added to pdostatement.rowcount
Groups: php.notes 
Request: Send a blank email to php-notes+get-181590@lists.php.net to get a copy of this message
When updating a Mysql table with identical values nothing's really affected so rowCount will return 0. As Mr. Perl below noted this is not always preferred behaviour and you can change it yourself since PHP 5.3. Just create your PDO object with <? php $p = new PDO($dsn, $u, $p, array(PDO::MYSQL_ATTR_FOUND_ROWS => true)); ?> and rowCount() will tell you how many rows your update-query actually found/matched. ---- Server IP: 91.199.167.223 Probable Submitter: 80.101.213.12 ---- Manual Page -- http://www.php.net/manual/en/pdostatement.rowcount.php Edit -- https://master.php.net/note/edit/104930 Del: integrated -- https://master.php.net/note/delete/104930/integrated Del: useless -- https://master.php.net/note/delete/104930/useless Del: bad code -- https://master.php.net/note/delete/104930/bad+code Del: spam -- https://master.php.net/note/delete/104930/spam Del: non-english -- https://master.php.net/note/delete/104930/non-english Del: in docs -- https://master.php.net/note/delete/104930/in+docs Del: other reasons-- https://master.php.net/note/delete/104930 Reject -- https://master.php.net/note/reject/104930 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181590) next »