Page 1 of 1

Question on PDO statements

Posted: Thu Oct 14, 2010 4:21 pm
by phenam
Hey all, new to the forum. I am trying to switch over to using PDO prepared statements. However, in situations with using "WHERE IN()" clauses, or multiple insert values such as "INSERT INTO table VALUES (x), (y), (z), how would one bind values? Is the only solution just to issue multiple statements and individually bind each set of values? Thanks in advance for any input! Have a great day.

Re: Question on PDO statements

Posted: Thu Oct 14, 2010 4:25 pm
by John Cartwright
http://ca2.php.net/manual/en/pdo.prepare.php wrote: You must include a unique parameter marker for each value you wish to pass in to the statement when you call PDOStatement::execute(). You cannot use a named parameter marker of the same name twice in a prepared statement. You cannot bind multiple values to a single named parameter in, for example, the IN() clause of an SQL statement.
So yea, bind each value individually.