Updating records in mysql databases with htmlphp Sexchataunty
It’ll contain an automatically incremented unique ID, create space for your fields, and keep track of when the submission occurred.
For more explanations of databases, try the My SQL home page or consider reading a complete guide to My SQL such as My SQL™: The Complete Reference, by Vikram Vaswani.
I’m actually going to go to six, because I like to attach a timestamp to every form submission – this information can really make your data a lot more useful.
CREATE TABLE survey ( sid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, q1_why VARCHAR(127) NOT NULL, q2_service TEXT NOT NULL, q3_state VARCHAR(2) NOT NULL, q4_comments TEXT NOT NULL, time_stamp TIMESTAMP NOT NULL) TYPE = MYISAM; code will create your basic My SQL table with six fields.
Let’s imagine a survey collecting four pieces of information: This form will be the centerpiece of our example form processing script.
Regardless of your chosen method of using data, you’ll need to have a script which collects the information from the form.
This can be the same for each processing choice — first gather all data, then build the final element which either sends your email, inputs data to your database, or adds information to your data file..
Both are useful, but in this case I’ll only be dealing with POST data.
This won’t necessarily be available on every hosting solution.
Regardless of your hosting service, however, if you use My SQL you will have to deal with the language which defines and interacts with the database – Tutorial.
However, the minimum you’ll need will be a single database table with five fields.
I’ve elected to skip examining the data for questions 1 and 2, because they are defined within the form.
There’s relatively little chance that they’re being faked.
If you want to learn more about the differences between the GET and POST methods, you might want to read an article describing the difference at length. Part of having a form online is the acknowledgement that whether through malice, incompetence, or accident, there will always be the possibility that your form will be used to send data other than what you intended.