cefalufr Posted May 4, 2006 Share Posted May 4, 2006 It Keeps Failing on insertion, someone point of my error? DB information is above this code btw![code]$fname = $_REQUEST['fname'];$lname = $_REQUEST['lname'];$state = $_REQUEST['state'];$state = $_REQUEST['city'];$zip = $_REQUEST['zip'];$userid = $_REQUEST['userid'];$query= 'INSERT INTO shipping_multiple (fname, lname, state, city, zip, userid) VALUES ("'.$fname.'","'.$lname.'","'.$state.'","'.$city.'","'.$zip.'","'.$userid.'")';mysql_query($query) or die('Failed Insertion For New User');[/code][code]$fname = $_REQUEST['fname'];$lname = $_REQUEST['lname'];$state = $_REQUEST['state'];$city = $_REQUEST['city'];$zip = $_REQUEST['zip'];$userid = $_REQUEST['shipping_multiple'];echo $fname;echo $lname;echo $state;echo $city;echo $zip;echo $userid;$query= 'INSERT INTO shipping_multiple (fname, lname, state, city, zip, userid) VALUES ("'.$fname.'","'.$lname.'","'.$state.'","'.$city.'","'.$zip.'","'.$userid.'")';mysql_query($query) or die('Failed Insertion For New User');[/code]It Echo's Back the Forms Variables perfectly but fails on insertion Quote Link to comment https://forums.phpfreaks.com/topic/9080-failing-on-insertion/ Share on other sites More sharing options...
.josh Posted May 4, 2006 Share Posted May 4, 2006 echo the query and then copy/paste it directly into phpmyadmin see if it inserts the row without issues.also, changing this:...or die('Failed Insertion For New User');to this:... or die(mysql_error());will give you better help for what's wrong. Quote Link to comment https://forums.phpfreaks.com/topic/9080-failing-on-insertion/#findComment-33407 Share on other sites More sharing options...
cefalufr Posted May 4, 2006 Author Share Posted May 4, 2006 [!--quoteo(post=371367:date=May 4 2006, 04:36 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 4 2006, 04:36 PM) [snapback]371367[/snapback][/div][div class=\'quotemain\'][!--quotec--]echo the query and then copy/paste it directly into phpmyadmin see if it inserts the row without issues.also, changing this:...or die('Failed Insertion For New User');to this:... or die(mysql_error());will give you better help for what's wrong.[/quote]Thks. Never thought of checking. Wrong column name for userid! Quote Link to comment https://forums.phpfreaks.com/topic/9080-failing-on-insertion/#findComment-33410 Share on other sites More sharing options...
.josh Posted May 4, 2006 Share Posted May 4, 2006 ah. yeh that happens :) Quote Link to comment https://forums.phpfreaks.com/topic/9080-failing-on-insertion/#findComment-33411 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.