Question on PDO statements
Moderator: General Moderators
Question on PDO statements
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.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Question on PDO statements
So yea, bind each value individually.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.