I have a table names
and in that table there is a field info
data is like this:
ID info
1 'alpha,romeo,ciera,delta'
2 'testing,temp,total'
I am trying to create a select query.
select * from names where info like '%$var%'
$var
is data from php.
Problem is i want exact match. If i use above query and in $var if data is
rome
then it also return row of romeo.
one more example-
data in table is testing,temp,total
user input data is test
then it also return testing
i tried
select * from names where info like '$var%'
and
select * from names where info like '%$var'
but it didn't return data as i expected.
Please advise how can i achieve this.
Note- : This is an example i am not using mysql as its depreciated. I am using mysqli