ItemID out of Sync - solved?
I think I figured this one out.
The ItemID's were out of sync because there is no way - that I can find - to get the next MySQL, auto-increment id without inserting a record first. So I was unable to generate the proper file name to be inserted into the record before the actual record insert.
The solution was kind of simple. In a nut shell I...
1. saved my update.php as insert.php
2. modified new insert.php to execute a INSERT query, before page load, to create a blank row. (I just gave one of the numeric fields a zero value)
3. grabbed the 'mysql_insert_id();' value and used it to generate an UPDATE query.
Granted, it's not perfect. If the user changes their mind after loading the insert.php, it will leave a blank record behind. I've got to figure that one out.
If anyone has a better way or any suggestions, please let me know.
Cheers
Doug