Ok, that was a tad long winded so to cut it down to basics.
I have a table called jobdetails with a field called job_no. This field is a Primary Key and an auto incremental field. As users submit jobs, the job_no field is assigned an auto-generated number. I want to let the users know what this number is after they log a job.
I can't think of how to word the query so that I only bring back the number associated with the job just logged.
An example of the way I'm thinking is this:
User logs a job and it is given the job_no of 22. I can write a query using something like
SELECT job_no from jobdetails where ____________
This is where I'm stumped. I could use
SELECT job_no from jobdetails WHERE DATE='$_POST['date']'
but that will bring back all the job_no's for a particular date. Alternatively I could use
SELECT job_no from jobdetails WHERE username=$_POST['username']
but this would bring back all job_no's for the user currently logging a job.
Am I being really stupid? I think possibly I am so if someone could point my in the right direction, I'd appreciate it.