I am trying to generate a MySQL
query with the data I have captured in a array
.
array(2) {
["area1"] => array(3) {
[0] => string(5) "item1"
[1] => string(5) "item2"
[2] => string(5) "item3"
}
["area2"] => array(2) {
[0] => string(5) "item1"
[1]=> string(5) "item2"}
}
}
What is the process to create a query that is a type?:
"select nombre, tipo from tabla1 where area1 in(item1, item2, item3) and area2 in (item1, item2)"
What would be the handling of bind
for these possible values?
Note: The number of areas and items can be
n
, of course, all this with thePDO
format.