RE: [PHP] Problems inserting into MySQL, please help! :(

From: Date: Mon, 18 Sep 2000 19:54:58 +0000
Subject: RE: [PHP] Problems inserting into MySQL, please help! :(
Groups: php.general 
Request: Send a blank email to php-general+get-17188@lists.php.net to get a copy of this message
You can try lots of things, You can echo $query; And then see if there is anything wrong with the query. If it looks fine, copy and paste it into mysql command prompt and see what happens. Mike -----Original Message----- From: Sandeep Hundal [mailto:sandeep_wde@yahoo.com] Sent: Monday, September 18, 2000 8:47 AM To: php-general@lists.php.net Subject: [PHP] Problems inserting into MySQL, please help! :( 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"> &nbsp; </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"> &nbsp; </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"> &nbsp; </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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#17188) next »