I'll try to make myself clear with an example:
Imagine an admin page to add a product to a database (product list). When I open the ADD ITEM page, the item is not yet created (not until I click the submit button), but let's say I want to add categories this product will appear in (with AJAX for example). When I run the AJAX script, i need to tell it which ID (my product) to put these categories in...
How should I do this.?
Is inserting a blank item in the database (to get mysql_insert_id) when the page opens a good way to do this.? Is it prone to conflicts or errors..?
I'm afraid this technique will populate the DB with lots of empty product because of admins reloading the page, leaving the page before submitting, etc...
How do you guys do it.?