How do I pass information in the bindvalue with two or more information stored in the variable?

0

I'm having a problem ... I'm getting some id in the database and storing it in $ids_cozinha . I gave var_dump and print_r , I'm returning the ids I want, so far so good.

<pre>
<?php print_r(implode(", ",$ids_cozinha))?>
</pre>

I have this result.

  

20, 21

I have a query in php prepare("SELECT XXXXX") that I need to insert these ids (21 and 21) that was stored in $ ids_cozinha, but in bindValue it is not accepting more than one id coming from variable $ids_cozinha , precisely because it is a array.

It's like this ..

$sql->bindValue(":ids_cozinha", implode(", ",$ids_cozinha));

Even though they are not accepting ids. You are only encountering the first ID that is the 20.

How can I pass these ids that are storing in this $ids_cozinha ?

PS: Executing the query directly into the database, are returning exactly all the information I need.

    
asked by anonymous 22.11.2018 / 18:45

0 answers