note 112792 added to class.pdostatement

From: Date: Tue, 23 Jul 2013 15:45:17 +0000
Subject: note 112792 added to class.pdostatement
Groups: php.notes 
Request: Send a blank email to php-notes+get-195736@lists.php.net to get a copy of this message
When using a PDOStatement in a foreach loop, the type of the value assigned depends on the second parameter of the preceding query. <?php foreach ($db->query($sql, PDO::FETCH_OBJECT) as $value) { // $value is a stdClass object } foreach ($db->query($sql, PDO::FETCH_NUM) as $value) { // $value is an array with numeric keys } ?> ---- Server IP: 69.147.83.199 Probable Submitter: 90.80.115.177 ---- Manual Page -- http://php.net/manual/en/class.pdostatement.php Edit -- https://master.php.net/note/edit/112792 Del: integrated -- https://master.php.net/note/delete/112792/integrated Del: useless -- https://master.php.net/note/delete/112792/useless Del: bad code -- https://master.php.net/note/delete/112792/bad+code Del: spam -- https://master.php.net/note/delete/112792/spam Del: non-english -- https://master.php.net/note/delete/112792/non-english Del: in docs -- https://master.php.net/note/delete/112792/in+docs Del: other reasons-- https://master.php.net/note/delete/112792 Reject -- https://master.php.net/note/reject/112792 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195736) next »