Can't get this to work, could you please take a look:
Connection works fine, table can be retrieved.
$Q2s = @mysql_query( 'SELECT Q2ID, Answer FROM q2');
if (!$Q2s) {
exit ('<p align="center"> Unable to gather data for question 2.</p>');
}
<div align="center">
<form action="questionres.php" method="post">
<fieldset>
<legend>Theia Questionnaire</legend>
</select></label><br />
<label> Q2: What is your secondary use?
<select name="q2id" size="6">
<option selected value=""> Please Select one...</option>
<?php
;
while ($q2 = mysql_fetch_array($Q2s)){
$q2id= $Qq2['id'];
$q2ans = htmlspecialchars($q2['Answer']);
echo "<option value='$q2id'>$q2ans</option>\n";
}
?>
<?php
$Q2s = $_POST['Answer'];
?>
<?php
$sql="INSERT INTO Savedq SET Q2s = '".$_POST['Answer']."'";
mysql_query($sql) or die("Could not process $sql");
?>
Error message: Could not process INSERT INTO Savedq SET Q2s = ''
Connection works fine, table can be retrieved.
$Q2s = @mysql_query( 'SELECT Q2ID, Answer FROM q2');
if (!$Q2s) {
exit ('<p align="center"> Unable to gather data for question 2.</p>');
}
<div align="center">
<form action="questionres.php" method="post">
<fieldset>
<legend>Theia Questionnaire</legend>
</select></label><br />
<label> Q2: What is your secondary use?
<select name="q2id" size="6">
<option selected value=""> Please Select one...</option>
<?php
;
while ($q2 = mysql_fetch_array($Q2s)){
$q2id= $Qq2['id'];
$q2ans = htmlspecialchars($q2['Answer']);
echo "<option value='$q2id'>$q2ans</option>\n";
}
?>
<?php
$Q2s = $_POST['Answer'];
?>
<?php
$sql="INSERT INTO Savedq SET Q2s = '".$_POST['Answer']."'";
mysql_query($sql) or die("Could not process $sql");
?>
Error message: Could not process INSERT INTO Savedq SET Q2s = ''