In my database there are 3 tables:
Posts:
-id
-title
-body
-date
Tags:
-id
-title
Posts_Tags:
-id
-post_id
-tag_id
When an user insert a post, my php code does 2 queries:
- Insert the post in the Posts table
- Insert a row for every tags associated with that post in the Posts_Tags table.
Is this the correct approach ?
Is there a way to simplify or to do 1 single query ?