Good morning everyone. I have a question that I can not solve.
In a given table of a BD I have a column that saves a string as follows:
1,2,3,4,5 Line 1
11.22,33,44,55 Line 2
Now you need to do a search to select only rows that have a given number eg:
Select column X where it contains the number 2
I tried the search using the code below, but it is returning me both line 1 and line 2, however I only needed line 1 which is where it has exactly the number 2 and not the line where it has the number 22
$sql = 'SELECT 'ativos' from 'produtos' WHERE 'ativos' LIKE "%'.$id.'%"';
Does anyone have any idea how I can solve this problem? Thanks in advance.