here is my new structure:
CREATE TABLE `tag_sys` (
`tagid` int(11) NOT NULL auto_increment,
`tag` varchar(255) NOT NULL default '',
`count` varchar(255) NOT NULL default '',
PRIMARY KEY (`tagid`)
) TYPE=MyISAM;
CREATE TABLE `blog_tags` (
`mainid` int(5) NOT NULL,
`tagid` int(11) NOT NULL,
`categoryID` int(4) NOT NULL default '0',
PRIMARY KEY (`mainid`)
) TYPE=MyISAM;
CREATE TABLE `wp_tags` (
`mainid` int(5) NOT NULL,
`tagid` int(11) NOT NULL,
`categoryID` int(4) NOT NULL default '0',
PRIMARY KEY (`mainid`)
) TYPE=MyISAM;
does this look like it will work better?
a user is about to submit a new blog entry. they enter 5 tags.
article goes into the artticle db.
blogid:25
article: <article>
catid: 4
Tags: (PHP, Code, HTML, Test, Help)
Tags get put into the tag sys db like so:
tagid: 1 tagid: 2 tagid: 3 tagid: 4 tagid: 5
tag: PHP tag: Code tag: HTML tag: Test tag: Help
count: 1 count: 1 count: 1 count: 1 count: 1
Blog tag DB.
since it was a blog the blog tag db will be updated like so:
mainid: 25
tagid: 1, 2, 3, 4, 5
categoryID: 4
Now if another article is entered it with the same tags it will add to the count field in the tag db.
Also if a white paper is entered into the db. the main white paper article will go into the wp DB. (lets say that id is 45 with a categoryid of 6)
then the tags into the tag db. like so:
Tags: (Download, White Paper, PDF, Test, Help)
Tags get put into the tag sys db like so:
tagid: 6 tagid: 7 tagid: 8 tagid: 4 tagid: 5
tag: Download tag: White Paper tag: PDF tag: Test tag: Help
count: 1 count: 1 count: 1 count: 3 count: 3
White Paper tag DB.
since it was a white paper the wp tag db will be updated like so:
mainid: 45
tagid: 6, 7, 8, 4, 5
categoryID: 6
Please let me know if this seems like its the right way to go about this.
i have two sections where a user can eneter tags into. i want it to be pretty much the same way this forum does it with tags. but instead of me just doing it for my blog system, id like to use it for the white paper section as well.
Thanks again for your help.