How should my mysql table look like when I allow a user to enter there post in multiple categories. Should it look like the below mysql table in example 1 or in example 2 or something different?
EXAMPLE 1
CREATE TABLE ac (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
categoryID INT UNSIGNED NOT NULL,
articleID INT UNSIGNED NOT NULL,
dateCREAT DATETIME NOT NULL,
PRIMARY KEY (id)
);
EXAMPLE 2
CREATE TABLE ac (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
categoryID INT UNSIGNED NOT NULL,
articleID INT UNSIGNED NOT NULL,
dateCREAT DATETIME NOT NULL,
PRIMARY KEY (id)
UNIQUE KEY (categoryID, articleID)
);