FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


tag system?





Mgccl
I was thinking of making tag system so it can replace the category system.
Category system is kind easy to make because you can define the level and what is under that level
but when I thought about the tag system, I can't think of an good answer.
The only one I have thought of is a db structure that can lead the program to find the tag

Code:

item_id *| tag_id *
1           | 1
1           | 2
1           | 3
2           | 2

Note: both ids are keys...
So what does you guys think? is this the perfect way to make tag system or is there better?
AftershockVibe
Thats the way you want to be thinking about it.

You need 3 tables. First, define the tags and the items:

Items(ItemId*, ItemName, etc)
Tags(TagId*,TagName)

Then a link table:

ItemTags(LinkId*, ItemId¬, TagId¬)

* - Primary Key
¬ - Secondary (Foreign) Key
Related topics
The Unofficial Jokes Thread
[TUTOR] A Short Intro to GD
Warning System?
Trading system
Karma/Reputation System
Battlefield 2
Official Age of Empires III Topic
PlayStation 3
Changements to the Points/frih$ system (Discuss)
Two Suggestions; for MarketPlace and Suggestions forum
neep help making email form that accepts html tags
sick of the old boring Tree system for everything(like CMS)
Problem with Member system(or template) and $_GET[id]
Relocation Advice Wanted (update: more specific)
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.