note 81743 added to function.PDOStatement-bindParam
| From: | phil | Date: | Wed, 12 Mar 2008 06:04:23 +0000 |
| Subject: | note 81743 added to function.PDOStatement-bindParam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136960@lists.php.net to get a copy of this message | ||
Building on from previous comment by Sam Bou...
bindParam() can be used in a loop like this:
<?php
...
$stmt = $db->prepare("INSERT INTO users (email) VALUES (:email)");
$stmt->bindParam(':email', $val, PDO::PARAM_STR);
foreach($emails as $val) $stmt->execute();
?>
----
Server IP: 117.104.160.194
Probable Submitter: 218.214.126.215
----
Manual Page -- http://www.php.net/manual/en/function.PDOStatement-bindParam.php
Edit -- https://master.php.net/note/edit/81743
Del: integrated -- https://master.php.net/note/delete/81743/integrated
Del: useless -- https://master.php.net/note/delete/81743/useless
Del: bad code -- https://master.php.net/note/delete/81743/bad+code
Del: spam -- https://master.php.net/note/delete/81743/spam
Del: non-english -- https://master.php.net/note/delete/81743/non-english
Del: in docs -- https://master.php.net/note/delete/81743/in+docs
Del: other reasons-- https://master.php.net/note/delete/81743
Reject -- https://master.php.net/note/reject/81743
Search -- https://master.php.net/manage/user-notes.php