1
I’m having a problem... I’m getting some id from the database and storing in $ids_cozinha
. gave a var_dump
and a print_r
, is returning me the id I want, so far so good.
<pre>
<?php print_r(implode(", ",$ids_cozinha))?>
</pre>
I have that result.
20, 21
I have a query on php prepare("SELECT XXXXX")
that I need to enter these ids (21 and 21) that were stored in $ids_kitchen, but bindValue is not accepting more than an id from the variable $ids_cozinha
, precisely because it is an array.
It’s like this..
$sql->bindValue(":ids_cozinha", implode(", ",$ids_cozinha));
They’re still not accepting the ids. It is only finding the first ID that is the 20.
How can I pass these ids that are storing in this $ids_cozinha
?
PS: Running the query directly in the database, are returning with accuracy all the information I need.
Welcome Raphael, it would be possible to post the entire code, it’s kind of hard to understand by these fragments...
– Alvaro Alves
Hello Alvaro, thanks for helping, if I post the whole code can end up getting confused even more, given that my query is a little large, because I do LEFT JOIN in several tables to insert the result in :ids_cozinha. Above this code I select and store these ids (array) in a $variable. So I do this. $ids_kitchen = $variable As
– Rafael Rocha