Click here to Skip to main content
15,033,219 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i have a form with more than one selection

i want to store what the user select on each category and then store it to a database in order to retrieve it back

for example i have the following selection options:
<form action="one.php" method="get">
<select name="q1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select><br>

<select name="q2">
<option value="car">car</option>
<option value="cat">cat</option>
<option value="bus">bus</option>
</select>
<input type="submit">
</form>


I know how to connect to database
but i want the code that will store the selection
and how i can retrieve it back to a form

thanks
Posted
Updated 20-Nov-09 5:29am
v2

Hi,

There are a number of tutorials which can guide you through them, step-by-step. One of the most notable is tizag.com.

I have picked out a couple of pages which are specific to your needs:

How to get the data from the form to the server
The difference between POST and GET
How to insert the data into the database
How to retrieve the data from the database

   
v2
The previous response is appropriate. As an alternative to propose another resource that specializes in php form - http://phpforms.net/php-forms.html
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900