note 89810 added to pdostatement.bindparam
| From: | Janci at osu1 dot php dot net | Date: | Tue, 24 Mar 2009 11:41:23 +0000 |
| Subject: | note 89810 added to pdostatement.bindparam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152374@lists.php.net to get a copy of this message | ||
@Alex: You might want to use something like this instead:
<?php
// $ids = array(1,2,3,4);
if (is_array($ids) && count($ids) > 0)
{
$placeholders = '?' . str_repeat(',?', count($ids) - 1);
$stmt = $db->prepare("select * from mytable where id in(" . $placeholders .
")");
$stmt->execute($ids);
}
?>
----
Server IP: 87.124.35.190
Probable Submitter: 217.144.149.222
----
Manual Page -- http://www.php.net/manual/en/pdostatement.bindparam.php
Edit -- https://master.php.net/note/edit/89810
Del: integrated -- https://master.php.net/note/delete/89810/integrated
Del: useless -- https://master.php.net/note/delete/89810/useless
Del: bad code -- https://master.php.net/note/delete/89810/bad+code
Del: spam -- https://master.php.net/note/delete/89810/spam
Del: non-english -- https://master.php.net/note/delete/89810/non-english
Del: in docs -- https://master.php.net/note/delete/89810/in+docs
Del: other reasons-- https://master.php.net/note/delete/89810
Reject -- https://master.php.net/note/reject/89810
Search -- https://master.php.net/manage/user-notes.php