【发布时间】:2015-11-24 14:28:23
【问题描述】:
我有一个 sql 请求:
$listUsers=$connection->prepare("SELECT u.id as userid From user u , account a where a.id_parent=$id_account OR a.id=$id_account and u.id_account=a.id ");
$listUsers->execute();
$users=$listUsers->fetchAll();
此请求为我返回用户 ID 列表。
我有另一个要求:
$listPush=$connection->prepare("select id from table_names where id_user in (?)");
$listPush->bindValue(1, $users);
$listPush->execute();
但是这样不行,我用implode来提取用户的id还是不行。
at ErrorHandler ->handleError ('8', 'Array to string conversion', 'C:\wamp\www\CleverMultimedias\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php', '67', array('param' => '1', 'value' => array(array('userid' => '10')), 'type' => '2'))
at PDOStatement ->bindValue ('1', array(array('userid' => '10')), '2')
有什么建议
【问题讨论】: