I am looking for help with the database scheme, not the actual "cloud" itself.
In a site where users submit images and can tag images, how should the database be setup for optimal performance?
I was thinking
ID - int(11), unique, auto_incremenet
tag - varchar(20)
imageID - int(11)
so suppose i upload an image, and tag it "toronto, sushi, summer".
query would be:
INSERT INTO tags (tag, imageID) VALUES ('$tag[0]', $imageID);
INSERT INTO tags (tag, imageID) VALUES ('$tag[1]', $imageID);
INSERT INTO tags (tag, imageID) VALUES ('$tag[2]', $imageID);
Then to retrieve, i'd select * from tags where imageID = $imagID.
Is there a flaw with this?