Jump to content

Archived

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

cefalufr

Failing on insertion

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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!

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.