View Single Post
Old 03-09-2008, 09:23 PM   #2 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

At first I'm leaning towards idea #1, but on second read, I'm gonna go with idea #3. The most logical one to me that is. If you search, you search on articles, but through the usage of tags. You can either search on the title (perhaps split by the whitespace) or on tags. Of course, a lot of other options can be implemented like date or author, but non of that now.

I think the most wise way to approach this is to indeed link them together.
Code:
---- TAGS Table
tag_id     |     int(15)      |     primairy, auto_increment, unique
article_id |     int(15)      |     unique     |     linked to an article
tags       |     varchar(255) |

---- ARTICLE Table
article_id |     int(15)      |     primairy, auto_increment, unique     |     used to link a tagtable
article_.. |     .......      |     ....
Since not every post has a tag, I think it is more logical to (on display) first retrieve the post, then check if there are tags (no? display a message perhaps) and of course, show the contents (and tags if available).
The process of searching is then rather simple. If the searchquery matches a tag from the tags table, it then shows every article and retrieves the information. Of course, linking them by ID to simply "SELECT article_id FROM articles WHERE article_id = $tagsQueryID".

I hope this gives you a bit of perspective.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
The Following User Says Thank You to ReSpawN For This Useful Post:
Alan @ CIT (03-09-2008)