Ok, so i’m wanting to implement a tagging system into something that i am working on. So far, i have just been planning all the functionality that i want to have. As in, i have done no coding for it yet.
Everything is pretty simple, except one thing. When doing a search, i want a list of tags that are common to every result returned by the search.
This is the layout i had planned so far.
[code]CREATE TABLE `object` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`value` VARCHAR(512) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `tag` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `tagMap` (
`tagId` INT(10) UNSIGNED NOT NULL ,
`objectId` INT(10) UNSIGNED NOT NULL ,
UNIQUE (`tagId`,`objectId`)
);