On HTML page 1 I ask for a first name and last name. When the form is submitted, the first initial of the first name and full last name are combined to create a string $fullname. $fullname is entered in a MySQL database as a unique identifer. Because of the nature of the string, it can be any number of characters long (...unless theres some way to make the string...7 charachters? Which would require short names, like jlee, to have extrac character added to the end?) Anyways, how do I ensure that noone will ever have the exact same identifier. For example, if James Hawthorne and Jill Hawtorne, 2 unrelated people, fill out the form, they won't both have the identifier jhawthorne. How do I do this?
okay, then how would I generate a unique numeric id from the HTML form? I know a new entry can generate a unique id in the db, but how does my form know any of that info and how do I verify if someone had already filled out the form?
well, if your just inserting information, your form DOESN'T need to know.
just have mysql do an auto-increment on your id field and have it default to whatever you want to start that.
that way whenver something's put in, it'll automatically put in a new, unique id number for that user.
and to verify you'd just do a select query on each field and see if that info exists.
Bookmarks