Hello. I do not even know how to ask a question. In general, there is a query with a search (like) on the table. With one value, I have no problem. But I can not reach me in any way how to search in this query by several values. Here is what I mean:
There is such a request
SELECT * FROM `table_text` WHERE `table_text`.`text` LIKE :text; He is looking for a certain value. But after I try to create a query that will look for several values, though I really have no idea how to implement it. Since I have values from the array, and their number is not always the same. Those. this time the values are 5, in the other there are 2, in the following there may be generally 20, etc. Therefore, I cannot write a query like this:
SELECT * FROM `table_text` WHERE `table_text`.`text` LIKE :text1 AND `table_text`.`text` LIKE :text2 // и т.д. Advise a way out. And I myself can not imagine how to implement it.
ANDneededOR- Alexey Shimansky$arrayData = ["yo1", "werui", 'testValue']; $columnName = 'text'; $sql = "SELECT * FROM `table_text` WHERE `$columnName` = '"; $sql .= implode("' AND `$columnName` = '", $arrayData)."'"; echo $sql;- Alexey Shimansky