Separating words and searching

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
kkonline
Forum Contributor
Posts: 251
Joined: Thu Aug 16, 2007 12:54 am

Separating words and searching

Post by kkonline »

I have a table articles, in which i am storing tags (separated by commas)
example for an article tags are life,confidence,success . Now this all is stored as a string. I want to extract each tag and search the table for it's occurance that means next i want to search for life confidence and success in the table and display results.

Above is just an example the actual tags can be much longer and separated by comma
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

Last edited by VladSun on Thu Aug 30, 2007 5:29 am, edited 1 time in total.
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

explode() on the commas in the string
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

I wouldn't store tags like that.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

kkonline, you've posted essentially the same question in two different forums here. That's called cross-posting and is not looked upon favorably. Please read and follow the rules for posting in these forums. Thank you.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

califdon wrote:kkonline, you've posted essentially the same question in two different forums here. That's called cross-posting and is not looked upon favorably. Please read and follow the rules for posting in these forums. Thank you.
Thanks for pointing this out.

Topic locked.
Locked