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:
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 name="q2">
<option value="car">car</option>
<option value="cat">cat</option>
<option value="bus">bus</option>
<input type="submit">

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

Updated 20-Nov-09 5:29am


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

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

The previous response is appropriate. As an alternative to propose another resource that specializes in php form -

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