I am building simple blogging framework using PHP and MySQL, and on the add new-post page I want to add live tags (like StackOverflow when asking questions). I can’t add tags directly to the database and link them to the current post because until clicking on Publish or SaveDraft there is no entry for current post.
Is there any way, I can tagging like StackOverflow and on clicking Publish or SaveDraft add them to database?
What you could do is immediatly assign an ID to the post (thus removing the ID problem), and have a “published” field that is 0 until the post is published.
In this way the tags are stored normally, as if the post were published, and the post is saved as a “draft”.