Jump to content


Photo

Help needed: returning tags stored in the DB


  • Please log in to reply
1 reply to this topic

#1 skeen

skeen
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 19 July 2006 - 07:22 AM

Hi people.

I have a users table, and each user has a tag field that stores tags (strings of text) like so:

php,mysql,phpfreaks

How do I return results where the tag field contains one of the tags?

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 19 July 2006 - 03:50 PM

Well, depending on the nature of the tags, you might want to have a FULLTEXT index that spans all 3 columns, as opposed to having to write a query with lots of LIKE '%aaa%' OR ....
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users