In general, if you use a many-to-many table (in this case, your
Blog_Tags table), it is easier to simply delete *all* records that related to the old version and then recreate the entire set.
After all, you must have code (PHP code, I assume?) that analyzes a given blog entry for the first time and extracts the appropriate tags, no? So, after a blog entry is edited, simply first do
Code:
DELETE FROM Blog_Tags WHERE blog_id = $blogid
And then use the same code you use for a new blog entry to reestablish the new list of blog tags for this blog.
Example, if the tags are
JavaScript, jQuery, AJAX then you could just do
Code:
INSERT INTO Blog_Tags (blog_id, tag_id)
SELECT $blogid, tag_id FROM Tags
WHERE tag IN ('JavaScript','jQuery','AJAX')
By far the simplest and most efficient way. Note that using IN( ) as I do here you insert all the relevant records in the Blog_Tags table in a single SQL statement.