Hi,
This is probably very easy, but as I am a newbie, I cannot figure an easy way to do exactly what I want.
What I am trying to achieve, is in essence, a form serial number generator. I have a PHP form that has various fields which output to a printout form and that all works fine. However, one of the fields, called serial (which is a "dead" field, disabling changes made to it) needs to have a serial number which I can specify (i.e ABC-123-001) but which I need to increment every time the form is visited (irrespective of same IP etc)
So if the form is refreshed 3 times, then the serial will increment 3 times (i.e ABC-123-003) and this is displayed within the "serial" form field on the form.
Should I create a dbase with a field in it using auto_increment, then include serial.php within the form field, and set serial.php to connect to the db and echo the serial? If so (and I know I sound stupid now, but my knowledge is fairly limited!) how would I go about echoing the serial from the db to serial.php? I understand how to create the db and include serial.php within the form field, just not too sure how to:
- Set the db up correctly with auto_increment
- Select the correct info within serial.php from the db.
Or is there another way of doing this?
Any help is much appreciated
TIA
Jonathen