note 95577 added to mysqli.prepare

From: Date: Sun, 10 Jan 2010 15:18:22 +0000
Subject: note 95577 added to mysqli.prepare
Groups: php.notes 
Request: Send a blank email to php-notes+get-164830@lists.php.net to get a copy of this message
It's worth noting that this function will error out with "Number of variables doesn't match number of parameters in prepared statement" for reasons that have nothing to do with the number of variables and parameters. For example, I made the newbie mistake of saying "SELECT (username, password) FROM mytable WHERE something = ?" instead of "SELECT username, password FROM mytable WHERE something = ?" and got that error. So basically, if you get that error, check your query syntax very carefully before poking around for the various problems that could occur with binding, pass-by-reference, etc. ---- Server IP: 192.41.40.227 Probable Submitter: 131.215.159.141 ---- Manual Page -- http://www.php.net/manual/en/mysqli.prepare.php Edit -- https://master.php.net/note/edit/95577 Del: integrated -- https://master.php.net/note/delete/95577/integrated Del: useless -- https://master.php.net/note/delete/95577/useless Del: bad code -- https://master.php.net/note/delete/95577/bad+code Del: spam -- https://master.php.net/note/delete/95577/spam Del: non-english -- https://master.php.net/note/delete/95577/non-english Del: in docs -- https://master.php.net/note/delete/95577/in+docs Del: other reasons-- https://master.php.net/note/delete/95577 Reject -- https://master.php.net/note/reject/95577 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#164830) next »