Answer the question
In order to leave comments, you need to log in
How to get the string containing the tag?
There is a tag column separated by commas like "green, big, strong". I know this is not the best way to store tags, I'll change this later, but you need to run a query to find a row containing a specific tag right now. For example, in the first entry such tags are: "green, big, strong". In the second: "green , big, strong." When I use
"SELECT * FROM tablename WHERE tags LIKE '%зелен%'"
Answer the question
In order to leave comments, you need to log in
This query works: select * from `table` where (tags LIKE '%tag,%' OR tags LIKE 'tag' OR tags LIKE '%, tag')
you can try regular expressions instead of LIKE but they are slow. better change the structure. it takes about 10 minutes, if the whole project has not yet spread
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question