Can someone help me get the SELECT query (2). below to work?
This string used for both SELECT statements:
$seller_items = ('6','9','12','13','14','15','16','17','18','19','20','22','23','24','25','26','28','27','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','53','54','55','57','58','59','60','62','63','64','65','61','67','56','69','70','74','73','75','78','80','76','72','95','94','101','102','71','103','2','104','4','81','21','10','11','3','79','5','8','7','97','93','96','98');
(1). This SELECT query is working fine:
if ($stmt = $mysqli->prepare("SELECT info FROM items WHERE item_id IN $seller_items AND active = ?")){
$stmt->bind_param("s",$active);
(2). This SELECT query is not working:
if ($stmt = $mysqli->prepare("SELECT info FROM items WHERE item_id IN ? AND active = ?")){
$stmt->bind_param("ss",$seller_items,$active);
I think placing the variable in the SELECT query itself may defeat the purpose of a prepared statement.
I can get the IN predicate to work just fine with a non-prepared statement. It's the prepared statement with which I am having the problem.
Thank you in advance.