Kudose, can you explain what this is beign used for? I remember somebody using the table status to find the value of the next insert getting absolutely panned because of the race conditions that will occur if you're using it in a multi-threaded environment, where by the time you read it, it might have already changed when you go to use it.
LAST_INSERT_ID() is available after you do an insert in the same script, and you can also read it with [MAN]mysql_insert_id()[/MAN] - but note that if you do a multiple insert statement it'll only return the value of the FIRST item entered.
The reason your code doesn't work is that you just read it alone, with an optional connection handle
SELECT LAST_INSERT_ID()
And it returns the last insert YOUR script did to any table with an auto increment.