note 95242 added to pdostatement.bindparam

From: Date: Mon, 21 Dec 2009 04:51:25 +0000
Subject: note 95242 added to pdostatement.bindparam
Groups: php.notes 
Request: Send a blank email to php-notes+get-164169@lists.php.net to get a copy of this message
binding array indexes to statements doesn't work as expected. I.e. <?php $arr=array("a","b"); $stm=$db->prepare("INSERT INTO foo VALUES (?,?)"); $stm->bindParam(1,$arr[0]) $stm->bindParam(2,$arr[1]); $stm->execute(); $arr=array("c","d"); $stm->execute(); ?> Instead of two rows with values a,b and c,d in the database you will have two rows of a,b. ---- Server IP: 202.89.58.1 Probable Submitter: 125.238.225.93 ---- Manual Page -- http://www.php.net/manual/en/pdostatement.bindparam.php Edit -- https://master.php.net/note/edit/95242 Del: integrated -- https://master.php.net/note/delete/95242/integrated Del: useless -- https://master.php.net/note/delete/95242/useless Del: bad code -- https://master.php.net/note/delete/95242/bad+code Del: spam -- https://master.php.net/note/delete/95242/spam Del: non-english -- https://master.php.net/note/delete/95242/non-english Del: in docs -- https://master.php.net/note/delete/95242/in+docs Del: other reasons-- https://master.php.net/note/delete/95242 Reject -- https://master.php.net/note/reject/95242 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#164169) next »