Problems inserting into MySQL, please help! :(
| From: | Sandeep Hundal | Date: | Mon, 18 Sep 2000 12:46:53 +0000 |
| Subject: | Problems inserting into MySQL, please help! :( | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17186@lists.php.net to get a copy of this message | ||
Hi all,
I'm making a fairly big suvery, which has about 15
questions on a page. Most of the answers are inputted as
radio buttons, with 1/1 checkbox answers.
But for some reason when I press submit for the values to
be inserted into a database, the table still shows empty
values. I've included my form underneath, and the query
which inserts the values, could anyone please help! :(
below is a sample question
**************************************
<tr>
<td valign="top"> <h1>4</h1> </td>
<td width="100"> </td>
<td valign="top"><strong class="white">How old where you
when you lost your virginity? </strong><br>
<table align="left" border="0">
<tr>
<td width="100"> </td>
<td valign="top"><small class="black">
<input type="radio" name="q4" value="14"> Under 15 <br>
<input type="radio" name="q4" value="15"> 15 <br>
<input type="radio" name="q4" value="16"> 16 <br>
<input type="radio" name="q4" value="17"> 17 <br>
<input type="radio" name="q4" value="18"> 18 <br>
<input type="radio" name="q4" value="19"> 19
</small><br>
</td>
<td width="50"> </td>
<td valign="top"><small class="black">
<input type="radio" name="q4" value="20"> 20
<br> <input
type="radio" name="q4" value="21"> 21 <br>
<input type="radio" name="q4" value="22"> 23 <br>
<input type="radio" name="q4" value="24"> 24 <br>
<input type="radio" name="q4" value="25"> 25 <br>
<input type="radio" name="q4" value="notlost"> Haven't
lost it yet
</small><br>
</td>
</tr>
</table>
</td>
</tr>
**************************
below is the php file with the query.
MySQL connect stuff goes here....
$query = "INSERT into $usertable (id, name, email, q1, q2,
q3, q4, q5, q6, q7, q8, q9, q10, q11, q12) values
(NULL,'$name','$email','$q1','$q2','$q3','$q4','$q5','$q6','$q7','$q8','$q9','$q10','$q11','$q12',)";
But it comes up as empty! :(
Any help would be appreciated... thanks
/sunny
__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/