note 82677 deleted from pdostatement.bindparam by danbrown

From: Date: Tue, 17 May 2011 18:09:50 +0000
Subject: note 82677 deleted from pdostatement.bindparam by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-179827@lists.php.net to get a copy of this message
Note Submitter: Charlie Smith ---- $result[] = array( 'storeid' => '1', 'testid' => '101' ); $result[] = array( 'storeid' => '2', 'testid' => '102' ); print_r($result); $row['storeid'] = '9'; $row['testid'] = '900'; $query = 'INSERT INTO pdotest SET storeid = :storeid, testid = :testid'; $statement = $dbconnection->prepare($query); $statement->bindParam(':storeid',$row['storeid']); $statement->bindParam(':testid',$row['testid']); foreach ($result as $row) { $statement->execute(); } Will insert 9,900 twice not the intended result of: 1,101 2,102

« previous php.notes (#179827) next »