Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 数组到字符串转换SQL Symfony_Php_Sql_Symfony - Fatal编程技术网

Php 数组到字符串转换SQL Symfony

Php 数组到字符串转换SQL Symfony,php,sql,symfony,Php,Sql,Symfony,我有一个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(); 这个请求为我返回一个u

我有一个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();
这个请求为我返回一个userid列表

我还有一个要求:

             $listPush=$connection->prepare("select id from table_names where id_user in (?)");
        $listPush->bindValue(1, $users);
        $listPush->execute();
但这不起作用,我用内爆来提取用户的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') 

你有什么想法吗?

我认为你的$users应该等于像“1,2,3,4”这样的字符串,而不是数组