Hello,
Try something like:
$query_DQL = 'SELECT ..... WHERE city=:str_id AND id IN
(:arr_users_ids) ';
$params = Array(
'str_id'=>$my_str,
'arr_users_ids'=>$arr_users_ids
);
$params_types = Array(
Connection::PARAM_STR,
Connection::PARAM_INT_ARRAY
);
El lunes, 8 de abril de 2019, 8:12:52 (UTC+2), Quan Qiu escribió:
>
> $sql = "SELECT * FROM FOO WHERE name = ? AND id IN (?)";
>
> $conn = $this->getDoctrine()->getConnection();
>
> $name='abc';
> $id_arr = ['5300','5400'];
>
> $result = $conn->fetchAll($sql, [$name, $id_arr]);
>
>
> I need to pass both string and array as a parameters to query status,
> Does anyone can point me how to pass array for IN statement? I did research
> online, but could not find useful instruction.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.