Jump to content

Failing on insertion


cefalufr

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/9080-failing-on-insertion/
Share on other sites

[!--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!
Link to comment
https://forums.phpfreaks.com/topic/9080-failing-on-insertion/#findComment-33410
Share on other sites

Archived

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

×
×
  • Create New...

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.