Jump to content

Enter a form select option into a MYSQL database?


ridgey28

Recommended Posts

I have been trying to figure out how to enter the the contents of a form select into a MYSQL database.  I am trying to setup a security question and answer for my project where you choose from several security questions.  I have tried several different things but to no avail I cannot figure this out.

 

<p><label for="question" title="question" accesskey="s">Security Question:</label>
	<select id="question" name="question">
		<option value="What is your Mother's maiden name?">What is your Mother's maiden name?</option>
		<option value="What is the name of your first school?">What is the name of your first school?</option>
		<option value="What is the name of your first pet?">What is the name of your first pet?</option>
		<option value="What is your favourite food?">What is your favourite food?</option>		
	</select></p>

 

$question =$_POST['question'];

 

$query5 = "INSERT INTO admin VALUES ('1','$name','$surname','$uname','$active_code','$md5_id','$authorise','$answer','$question','$pword')";
mysql_query($query5);

 

Everything else goes into the database fine so it has narrowed it down to this wee problem.

 

Any help would be appreciated.

 

Thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.