0

My previous question seems to be unclear.so im putting a new question with more clear data

mysql like issue on partial match

The query

SELECT * FROM t_groups WHERE group_name LIKE '%pla%'

The results

enter image description here

MY question is when user search for something like 'plablablabla',How can i show all the results in the above image..i tried LIKE and RLIKE and im not good with regular expressions..any help is highly appreciated

2 Answers 2

1

you need the mysql regexp keyword. More info at http://dev.mysql.com/doc/refman/5.1/en/regexp.html

Sign up to request clarification or add additional context in comments.

Comments

0
SELECT * 
FROM t_groups 
WHERE group_name REGEXP 'pla'

3 Comments

empty results when i searched SELECT * FROM t_groups WHERE group_name REGEXP 'plablablaaa';
because plablablaaa is not contained on the list above. so you want to search for plablablaaa but still display Plain? how is that possible.
Because Plain and plablabla both starts with 'pla'..anyway to do with regular expression ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.