If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

but what I'm getting instead of the list of the items is an error "SQLSTATE[HY093]: Invalid parameter number: parameter was not defined". But surely I do have it defined - even echoeing $product_id gives me a single digit of 4. What am I doing here wrong folks?

Edit:
Also consider what the poster below me stated - Without knowing what the code wrapping the code you posted is, the method he mentions is what you should strive for. The least amount of talk between the database and your website is best

But it's giving me error SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Array'' at line 1.

Users who have thanked hinch for this post:

You cannot bind this way. Think of what the statement is doing, it is preparing the statement, and then providing "an" argument. When you say IN (?), that is a single parameter, and if you were to implode an array it would still be a string.
To bind using a prepared statement and an IN clause, you need to assemble the string first and then execute it. Fortunately, PDO does allow an array of bind unlike the MySQLi which does not (so its easier in PDO statements to do this).