Alright - enough. This was driving me nuts, and no, it wasn't a problem I fixed by checking errors, etc.
This is a very common problem (just do a search for the error string in Google and see how many others have had thier own problems documented in the cache for all to see.) Stems from a 3 to 4 conversion, and here's a quick fix I found when you're looking to use results from one query after the other. For a more detailed solution, see the answer I found on another PHP board.
Step 1 - Get rid of your mysql_insert_id statement.
Step 2 - Where you would have placed your var in your INSERT statement, use LAST_INSERT_ID() instead (no quotes, etc.)
Step 3 - Read the rest of this post if you need more help and that for some reason doesn't work.
This was a very simple fix with a slew of different answers avail - it needs to be addressed at some point in greater detail. Hopefully this will help some.
If you want to use the ID that was generated for one table and insert it
into a second table, you can use SQL statements like this:
INSERT INTO foo (auto,text)
VALUES(NULL,'text'); # generate ID by inserting NULL
INSERT INTO foo2 (id,text)
VALUES(LAST_INSERT_ID(),'text'); # use ID in second table
...found here:
http://www.mysql.com/doc/G/e/Getting_unique_ID.html
It works even without inserting the NULL value for some reason 😉
The following is great for monitoring:
$new_id = mysql_insert_id();
print "New id: $new_id\n";