Jump to content

Archived

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

jowchie

$_POST limitations????

Recommended Posts

i have a project duenext week and i am stuck with a problem with mysql query that im trying to run.

 

i have a very long query string posted from a different html form page. then this string is fed to my intrams.php page and all the keys and values are saved in a certain variable though $_POST, but when i run the query to add these new items to different table they don\'t seem to the first table, but the rest are just fine... and when i check to see if my tables have the data. all of the rest of the tables have the data, except for the first one, which is kinda weird.

 

here is a snippet of the code:

 


<?php

$first = $_POST[\'first\']; 

$last = $_POST[\'last\'];

$id = $_POST[\'id\'];

$tel = $_POST[\'tel\'];

$email = $_POST[\'email\'];

$gender = $_POST[\'gender\'];

$basket = $_POST[\'basket\'];

$volleyball = $_POST[\'volleyball\'];

$badminton = $_POST[\'badminton\'];

$football = $_POST[\'football\'];

$bowling = $_POST[\'bowling\'];

$golf = $_POST[\'golf\'];

$pingpong = $_POST[\'pingpong\'];

$racquet = $_POST[\'racquet\'];

$leagues = $_POST[\'leagues\'];

$setup = $_POST[\'setup\'];

$teach = $_POST[\'teach\'];

$beach = $_POST[\'beach\'];

$bonfire = $_POST[\'bonfire\'];

$tail = $_POST[\'tail\'];

$pep = $_POST[\'pep\'];

$tva = $_POST[\'tva\'];

$water = $_POST[\'water\'];

$web = $_POST[\'web\'];



$connect = mysql_connect("h", "u", "p") or die("could not connect to jowchie\'s database"); 



mysql_select_db("db", $connect) or die("i cant seem to get in jowchie\'s database, please contact him");



$tae = "INSERT INTO intram_contacts VALUES (\'$first\',\'$last\',\'$id\',\'$tel\',\'$email\',\'$gender\',\'$leagues\',$setup\',\'$teach\',\'$beach\',\'$bonfire\',\'$tail\',\'$pep\', \'$tva\', \'$water\',\'$web\')";

$sql2 = "INSERT INTO basket VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$basket\',\'$leagues\')";

$sql3 = "INSERT INTO volleyball VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$volleyball\')";

$sql4 = "INSERT INTO badminton VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$badminton\')";

$sql5 = "INSERT INTO football VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$football\')";

$sql6 = "INSERT INTO bowling VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$bowling\')";

$sql7 = "INSERT INTO golf VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$golf\')";

$sql8 = "INSERT INTO pingpong VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$pingpong\')";

$sql9 = "INSERT INTO racquet VALUES (\'$first\',\'$last\',\'$email\',\'$gender\',\'$racquet\')";







$result1 = mysql_query($tae);

$result2 = mysql_query($sql2);

$result3 = mysql_query($sql3);

$result4 = mysql_query($sql4);

$result5 = mysql_query($sql5);

$result6 = mysql_query($sql6);

$result7 = mysql_query($sql7);

$result8 = mysql_query($sql8);

$result9 = mysql_query($sql9);

 

the $tae variable with the query command doesnt seem to work... please, i need help on this i am a beginner. when i check all the contents of all the tables, they\'re all fine, but when i check to see if the intram_contacts table is ok, there is absolutely nothing but an empty set.

Share this post


Link to post
Share on other sites

Use a die statement and check if the query is having some issues.

 

Also ensure that you have supplied all the vlaues.

Share this post


Link to post
Share on other sites

also, check the post_max_size line your php.ini to make sure you are allowing enough data to pass.

 

a code suggestion: clean up the beginning assigns from post to normal by using a foreach loop. if you unsure what i mean, search the forum for: foreach POST

Share this post


Link to post
Share on other sites

i work with my php files through a remote ssh connection, and i do not have root permissions for the php.ini,

 

and thanks for the for loop suggestion...

Share this post


Link to post
Share on other sites

×

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.