I have a problem when using commas separating distinct values contained in a column. I call a query as follows:
$findd = KL123,OTHER123 $query = "SELECT * FROM test1 WHERE concat_ws(' ', column1, column2) LIKE '%".$findd."%' OR concat_ws(' ', column2, column1) LIKE '%".$findd."%'";
So, I would like to search for words separated by commas with the following value
$findd= KL123,OTHER123 in a table that contains the following data:
ID name column1 column2 -- ---- --------- ------- 1 dan KL123 2 lolo ASI22 OTHER123,KL145 3 lala TA123 4 ttoo OTHER123
But no results "found". I would like to "find" the IDs
But if I search without commas the value
$findd= OTHER123 works with the same data shown above, because I "get" the IDs
How can I solve this task with commas?
My level in MySQL is very basic and I find it difficult to solve this.