Answer the question
In order to leave comments, you need to log in
How to find array value in database?
Good afternoon.
The database has a table `events` (Events) in which there is a field `categories` ( Categories of events )
in the categories field there is an array with category identifiers of this format ["1", "2", "3", etc.].
The question is how you can display the event knowing the category id.
I tried to solve the problem in this way:
$result = $db->query('SELECT * FROM events WHERE categories LIKE "%'.$category_id.'%" ');
Answer the question
In order to leave comments, you need to log in
implemented through the pop, well, if not refactor, then
and it's sad
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question