I wish I could make a query that filters the results. It works when I make this request alone:
SELECT * FROM products_details WHERE active = '1' AND category LIKE '% Phobies%';
But in my code, when test, I have this error that appears every time:
Fatal error: Uncaught PDOException: SQLSTATE [42S22]: Column not found: 1054 Unknown column '' in 'where clause' in C: \ laragon \ www \ tresorsdufutur \ ajax.php on line 36
But I do not have an IN in my query and all the terms come from the same column. I really can not find or find my mistake. Here is my code
$ query = "SELECT * FROM products_details WHERE active = '1'";
if (isset ($ category) &&! empty ($ category)) {
$ categorydata = implode ("','", $ category);
$ query. = "AND product_category LIKE (`$categorydata`) ";
}