Just want to know how I can filter out a result using mysql if the “content” field contains a hashtag.
e.g. If a result content is: “#Euro2012 is going to be awesome”
I would not have this returned in my MySQL results….
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For varchar fields you can use LIKE:
For text fields you’ll need to look into full-text search.
Update (Suggested by comments):
Regular Expression Solution:
If you want to filter by fields that begin with a hashtag add
^to the regular expression.