将数组与db列mysql进行比较

时间:2017-01-21 21:12:05

标签: php mysql

我有以下查询

<?php  
$returnedproducts = explode(',',$result['Product']);  
$get = $db->prepare("SELECT * FROM Products WHERE Id IN (' . implode(",", :returned) . ')'");
$get->bindParam(':returned', $returnedproducts);
$get->execute(); 
$results = $get ->fetchAll(); 
?>

数据库中的产品存储如1,2,3,4

但是我收到错误PDO :: prepare()期望参数2是数组

如何调整返回的变量产品以实现此目标

0 个答案:

没有答案