I have a column in my table of type SET('alpha','beta','gamma','delta','...','omega') and name 'alphabet'
My PHP query is
$string = "gamma"
SELECT * FROM table WHERE alphabet LIKE "%$string%"
So I would like to return all of the rows where gamma is in the column alphabet, regardless of whar other values are in there too as it is a SET type.
What would the sql query be?
SELECT * FROM table WHERE find_in_set('$string', alphabet) > 0
FIND_IN_SET Doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With