I would like to clarify a little the toxicity method of storing tags in a database mentioned elsewhere on SO.
Database Schema:
Table: Item Columns: ItemID, Title, Content Table: Tag Columns: TagID, Title Table: ItemTag Columns: ItemID, TagID
This is probably a stupid question (but I donβt know the answer) ... If each entry in the Tag Tag has a unique title. those. Am I only saving the tag once or am I saving it every time I use it?
To illustrate which of the two tables below should contain:
TagID Title 1 Fish 2 Cat 3 Dog
or
TagID Title 1 Fish 2 Fish 3 Cat 4 Fish 5 Dog 6 Cat
If you use the first table, before entering the tag, I must first run the sql statement to find out if it exists, right?
Any help would be appreciated. Recently, I had my fingers due to hacking and indexing, you want the source data to be correct.
sql database mysql
Ross
source share