Hi, in one of my MySQL table's I have a row called "ID" its a primary key, and is Auto_Increment'ed. Anyway, when I add a new row to this table, I want to be able to then pull the new value of ID back out for use later on in the script. I was woundering how I would do this, I took a look at mysql_affected_rows() and that only returns the number of rows affected (which in this case WILL only be 1).
The only thing I could come up with after the query, pull the entire ID colume out, and ordering it numerical order, and pulling out the highest value, but I didn't think this would be real efficent, and I would also run the risk of having another query add a row after my Insterted one, but before I pull everything back out, thus giving me an inncorrect row ID number.
If anyone can help me it would be greatly appreciated.