title: Job no issue assignig to multiple users
body: <p>Let me describe the problem in detail.<br>
  I have a table called export. Which has a field job_no.<br>
  When a user comes and fills this query run    </p>
  
  <pre><code>select  max(job_no) as Last_Job from jobs
  </code></pre>
  
  <p>The result is A005 which is the last job number in the table.<br>
  On the PHP end I display A006 in the entry form which user is going to fill and submit.<br>
  The job_no field in the form is read only and user can not change it.<br>
  Now here comes the problem if multiple user are filling the form at the same time A006 is being displayed to each and when they submit the form A006 is submitted with their record.<br>
  Which is duplicate and is not required.<br>
  Now what should be the solution to prevent this situation.
  I have three solutions but i want to know if there is some better solution.    </p>
  
  <p>Solution 1<br>
  I insert the job number to user_entry form with user id  and display it to user.<br>
  Then when user submits the form i update it.<br>
  Draback seems that if user cancels the form submission the job_no is useless then. </p>
  
  <p>Solution 2<br>
  I display the job number to each user and when submitting i check the job number , increment it and tell the user that the job number has already been assigned so he is going to be assigned the next one.<br>
  if i don't display the prompt message to user he will be under the impression that his job number is A006 where in the database it will be A007.</p>
  
  <p>Also if i run ajax request with setInterval it will be a load on server and there is still chance of duplicate.</p>
  
  <p>This is necessary to display the job number to the user. So what is the better approach in this situation. Or is there any alternative to this problem?</p>