note 71780 added to function.pdostatement-bindvalue
| From: | ts//tpdada//art//pl at osu1 dot php dot net | Date: | Fri, 15 Dec 2006 14:34:15 +0000 |
| Subject: | note 71780 added to function.pdostatement-bindvalue | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120635@lists.php.net to get a copy of this message | ||
For bind whole array at once
<?php
function PDOBindArray(&$poStatement, &$paArray){
foreach ($paArray as $k=>$v){
@$poStatement->bindValue(':'.$k,$v);
} // foreach
} // function
// example
$stmt = $dbh->prepare("INSERT INTO tExample (id,value) VALUES (:id,:value)");
$taValues = array(
'id' => '1',
'value' => '2'
); // array
PDOBindArray($stmt,$taValues);
$stmt->execute();
?>
----
Server IP: 217.174.196.197
Probable Submitter: 80.170.66.22
----
Manual Page -- http://www.php.net/manual/en/function.pdostatement-bindvalue.php
Edit -- https://master.php.net/note/edit/71780
Del: integrated -- https://master.php.net/note/delete/71780/integrated
Del: useless -- https://master.php.net/note/delete/71780/useless
Del: bad code -- https://master.php.net/note/delete/71780/bad+code
Del: spam -- https://master.php.net/note/delete/71780/spam
Del: non-english -- https://master.php.net/note/delete/71780/non-english
Del: in docs -- https://master.php.net/note/delete/71780/in+docs
Del: other reasons-- https://master.php.net/note/delete/71780
Reject -- https://master.php.net/note/reject/71780
Search -- https://master.php.net/manage/user-notes.php