Hope someone can help me out with this.
I'm having trouble getting my radio button values into a MySQL database. And after I do get them inserted I'm going to want to be able to show them back in the form again (if the respondent didn't finish the whole form the first time). My text and textarea fields are inserting just fine and I'm able to bring those back up too. It's just the radio buttons that aren't working. When I created the table I used VARCHAR. Was that even right?
These are the radio buttons in my form:
[HTML]
1st Question:
<p><input type="radio" name="QA" value="AA"> 1st Choice</p>
<p><input type="radio" name="QA" value="AB"> 2nd Choice</p>
<p><input type="radio" name="QA" value="AC"> 3rd Choice</p>
<
<p></p>
<p>2nd Question:</p>
<p><input type="radio" name="QB" value="BA"> 1st Choice</p>
<p><input type="radio" name="QB" value="BB"> 2nd Choice</p>
<p><input type="radio" name="QB" value="BC"> 3rd Choice</p>[/HTML]
These are the instructions on the page where I'm updating them into a table called "XXX". $_SESSION['passcode' comes from a signup page. On that page I've got the INSERT code to get their name and other info. I also insert blank spaces for all the other fields I'll be needing.
[PHP]$AA = $_POST['AA'];
$AB = $_POST['AB'];
$AC = $_POST['AC'];
$BA = $_POST['BA'];
$BB = $_POST['BB'];
$BC = $_POST['BC'];
mysql_query("UP DATE XXX SET AA='$AA', AB='$AB', AC='$AC', BA='$BA', BB='$BB', BC='$BC' WHERE passcode='{$_SE SSION['passcode']}'")
or die(mysql_error ()); [/PHP]
I'm not sure how to select the radio buttons because I haven't been able to test it since I can't get the data into the database.
Many thanks.
					I'm having trouble getting my radio button values into a MySQL database. And after I do get them inserted I'm going to want to be able to show them back in the form again (if the respondent didn't finish the whole form the first time). My text and textarea fields are inserting just fine and I'm able to bring those back up too. It's just the radio buttons that aren't working. When I created the table I used VARCHAR. Was that even right?
These are the radio buttons in my form:
[HTML]
1st Question:
<p><input type="radio" name="QA" value="AA"> 1st Choice</p>
<p><input type="radio" name="QA" value="AB"> 2nd Choice</p>
<p><input type="radio" name="QA" value="AC"> 3rd Choice</p>
<
<p></p>
<p>2nd Question:</p>
<p><input type="radio" name="QB" value="BA"> 1st Choice</p>
<p><input type="radio" name="QB" value="BB"> 2nd Choice</p>
<p><input type="radio" name="QB" value="BC"> 3rd Choice</p>[/HTML]
These are the instructions on the page where I'm updating them into a table called "XXX". $_SESSION['passcode' comes from a signup page. On that page I've got the INSERT code to get their name and other info. I also insert blank spaces for all the other fields I'll be needing.
[PHP]$AA = $_POST['AA'];
$AB = $_POST['AB'];
$AC = $_POST['AC'];
$BA = $_POST['BA'];
$BB = $_POST['BB'];
$BC = $_POST['BC'];
mysql_query("UP DATE XXX SET AA='$AA', AB='$AB', AC='$AC', BA='$BA', BB='$BB', BC='$BC' WHERE passcode='{$_SE SSION['passcode']}'")
or die(mysql_error ()); [/PHP]
I'm not sure how to select the radio buttons because I haven't been able to test it since I can't get the data into the database.
Many thanks.
Comment