Number Generator

Results 1 to 3 of 3

Thread: Number Generator

  1. #1
    Mark Guest

    Default Number Generator

    I would like to add a sequential number to a form that my visitors will fill in on my website. In other words each time somebody access the form it must show a refernece number (the sequential number) and this number has to be added to the same database as the details of the form.

  2. #2
    Join Date
    Dec 1969

    Default RE: Number Generator

    You could keep the number as a separate field and if necessary a separate table in the database. A new user would look at the highest number and add to it. When the form is entered into the database, the number would be stored in another field belonging to that user.<BR><BR>You could also house the number in a text file and sequentially update that file. The problem with that approach, is if there is a lot of traffic on the site. The text file might not keep up. However, if you have a variable that is toggled on/off when the text file is open, you can prevent someone using the same number.

  3. #3
    Rupert Guest

    Default RE: Number Generator

    I had the same problem - to give each request a unique number, and this is how I got round it. In my database table I had 3 columns, an ID (sequential number), date/time added, problem(text).<BR><BR>When the user pressed submit, I stored the date/time in a varible and then inserted that varible and the problem in the database. After that I queried the database to return the ID for the record where the time is equal to the stored varible and the problem field is equal to the problem I just added. I could then print this ID to the browser so that they had a unique reference. <BR><BR>IF your confused ask for clarification!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts