note 108038 added to mysqli-stmt.prepare

From: Date: Fri, 23 Mar 2012 17:34:04 +0000
Subject: note 108038 added to mysqli-stmt.prepare
Groups: php.notes 
Request: Send a blank email to php-notes+get-186795@lists.php.net to get a copy of this message
Turns out you can't directly use a prepared statement for a query that has a placeholder in an IN() clause. There are ways around that (such as constructing a string that consists of n question marks separated by commas, then using that set of placeholders in the IN() clause), but you can't just say IN (?). This is a MySQL restriction rather than a PHP restriction, but it's not really documented in the MySQL docs either, so I figured it was worth mentioning here. (Btw, turns out someone else had previously posted the info that I put in my previous comment, about not using quotation marks. Sorry for the repeat; not sure how I missed the earlier comment.) ---- Server IP: 192.41.42.26 Probable Submitter: 67.180.87.190 ---- Manual Page -- http://www.php.net/manual/en/mysqli-stmt.prepare.php Edit -- https://master.php.net/note/edit/108038 Del: integrated -- https://master.php.net/note/delete/108038/integrated Del: useless -- https://master.php.net/note/delete/108038/useless Del: bad code -- https://master.php.net/note/delete/108038/bad+code Del: spam -- https://master.php.net/note/delete/108038/spam Del: non-english -- https://master.php.net/note/delete/108038/non-english Del: in docs -- https://master.php.net/note/delete/108038/in+docs Del: other reasons-- https://master.php.net/note/delete/108038 Reject -- https://master.php.net/note/reject/108038 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186795) next »