finding the newest id in the database efficiently
Posted: Fri Sep 23, 2005 7:36 pm
Hi all,
I have a function that adds a client to the database. Then, I want to extract that clients ID from mysql (using php). I want this the moment after the client has been added.
What is the most efficient way to do this? Currently I am parsing through the WHOLE database, taking the ID, then when I get to the last client, I have the latest ID. It's aweful
Any suggestions appreciated.
Rob
I have a function that adds a client to the database. Then, I want to extract that clients ID from mysql (using php). I want this the moment after the client has been added.
What is the most efficient way to do this? Currently I am parsing through the WHOLE database, taking the ID, then when I get to the last client, I have the latest ID. It's aweful
Any suggestions appreciated.
Rob