Drop down boxe selections to php my admin

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Jan 10, 2012 6:58 pm

Drop down boxe selections to php my admin

Postby melcox80 » Tue Jan 10, 2012 7:11 pm

Hi All, I am new herer this is my first post. I have only in the last couple of weeks started using/learning php. I have created an online registration form for our club. In that form I have dropdown boxes. All the other information gets to myphpadmin table correctly. However there is no entry in the table where the dropdown boxes were. I'm not sure if I have the tag wrong or if I have to change the option in the table.

Can anyone help? What have I done wrong? It's urgent as people are registering and I don't know what their class or age is!


<form method="post" action="event_rego.php">
<div class="formbox"><select name="age" type="text" width="400" >
<option>Choose One</option>
<option>Sundown superx race 1 (21st Jan)</option>
<option>Sundown superx race 2 (18th Feb)</option>
<option>Sundown superx race 3 (24th March)</option>
<option>Sundown superx race 4 (28th April)</option>
<div class="formbox"><input name="fname" type="text" width="400" /></div>
<div class="formbox"><input name="sname" type="text" width="400" /></div>
<div class="formbox"><input name="email" type="text" width="400" /></div>
<div class="formbox"><input name="phone" type="text" width="400" /></div>
<div class="formbox"><input name="address" type="text" width="400" /></div>
<div class="formbox"><input name="city" type="text" width="400" /></div>
<div class="formbox"><input name="state" type="text" width="400" /></div>
<div class="formbox"><input name="postcode" type="text" width="400" /></div>
<div class="formbox"><input name="country" type="text" width="400" /></div>
<div class="formbox"><select name="age" type="text" width="400" >
<option>Choose One</option>
<option>Under 12</option>
<option>Under 16</option>
<option>16 - 30</option>
<option>31 - 40</option>
<option>Over 40</option>
<div class="formbox"><select name="sex" type="text" width="400" >
<option>Choose One</option>
<div class="formbox"><select name="class">
<option>Choose One</option>
<option>Pro A</option>
<option>C (Clubman)</option>
<option>Vets (40+)</option>
<option>Juniors (90cc)</option>
<option>Juniors (50cc)</option>
<option>Pit Bikes</option></select>

<div class="formbox"><input type="submit" name="submit" value="Submit" /></div>





mysql_query("INSERT INTO event_register (event, fname, sname, email, phone, address, city, state, postcode, country, age, sex, class)
('$event','$fname','$sname','$email','$phone','$address','$city','$state','$postcode','$country','$age','$sex','$class') ")
or die(mysql_error());

echo "Thankyou!";


New php-forum User
New php-forum User
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA

Re: Drop down boxe selections to php my admin

Postby rupali » Tue Jan 10, 2012 9:14 pm


use value keyword there after option

for example

<select name="colour">
<option value="Choose one">Choose one</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest