This is a mysql heavy question but i think it has some relevance to php so ill post it here.
I have a few tables that when new data is inserted into them they will have new unique ID number generated for them by mysql... for example
INSERT INTO db_table SET id=null, name="dan", age="23"
Now in php I have always ran 2 queries, one for the insert and the other for getting the ID that mysql has set for the just inserted data. Is there a way that i can get the ID back in a single query in php, maybe like....
Would $array['id'] equal the generated ID?
Is there a technique out there I am missing to do this?
I'm just wondering, trying to cut down running unnecessary queries in a script.