Forum Moderators: coopster
I have to create the tags related to a post in the table 'post_tags'.
Example I have post with ID 1 and I need to assign tag 5, 6 and 7 to the post but putting the entries in the 'post_tags' table.
postid/ posttag
1 5
1 6
1 7
Is there a way to put them all in one statement rather than having to make an SQL statement for each one?
At the moment it's
INSERT INTO posttags (postid, tagid) values (1, 5)
INSERT INTO posttags (postid, tagid) values (1, 6)
INSERT INTO posttags (postid, tagid) values (1, 7)
I am looking maybe there is a better way how to do it.
Thanks :)