note 81743 deleted from pdostatement.bindparam by danbrown
| From: | danbrown@php.net | Date: | Tue, 17 May 2011 18:10:29 +0000 |
| Subject: | note 81743 deleted from pdostatement.bindparam by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179828@lists.php.net to get a copy of this message | ||
Note Submitter: phil[AT]papg[DOT]net
----
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();
?>