I am trying to submit an HTML <form> and have the input and select information entered into a MySQL database table. My code is entering the <input type="text"> data into the table, but it is not entering the data in the <select>.
This is the <form> I have been using:
<form enctype="multipart/form-data" action="send.php" method="post">
<select name="gender">
<option value="Male"> Male</option>
<option value="Female">Female</option>
</select>
<input type="text" name="name">
<input type="submit" value="Add">
</form>
And this is the PHP I've been using to enter the form into the table:
<?php
$gender=$_POST['gender']; // This is the select/dropdown
$name=$_POST['name']; // This is the text input
mysql_connect("", "", "") or die(mysql_error()) ;
mysql_select_db("") or die(mysql_error()) ;
mysql_query("INSERT INTO `table1` VALUES ('$gender', '$name')") ;
?>