I have a field in a table with data separated by a comma:
id_regioes: 1,2,3,4,5,6
.
When I do the query "SELECT * FROM 'tb_operadora' WHERE 'id_regioes' = 1"
, or "= 6"
returns ok, but not when they are in 2,3,4,5. Even using LIKE
. I guess because I need to mount an array before the query .
How do I find the data in PHP + MySQL?
When I search in this field separated by commas, it only finds items that fit the first and / or last record of the field.