Jump to content

Recommended Posts

[code[

$queryreg = mysql_query("INSERT INTO application VALUES ('','$fname','$fname','$lname','$addy','$city','$state','$zip','$hphone','$wphone','$ssn','$dob','$aemail','$dl','$dlstate','$property','$employer','$eaddy','$ecity','$estate','$estate','$ezip','$supervisor','$empstartdate','$felony','$creditcard','$cardname','$cardaddress','$cardnum','$pets','$grossincome','$cardexp','$cvv','$cardinit','$fullname','$ref1','$ref1ph','$ref2','$ref2ph','$ssn2','$security','$date','$cphone','','','')") or die(mysql_error());

 

It dies everytime with th same error: "Column count doesn't match value count at row 1"

 

 

Link to comment
https://forums.phpfreaks.com/topic/200788-error-in-php-to-sql/
Share on other sites

$queryreg = mysql_query("INSERT INTO application (YOU MUST HAVE THE ROW NAMES HERE!) VALUES ('','$fname','$fname','$lname','$addy','$city','$state','$zip','$hphone','$wphone','$ssn','$dob','$aemail','$dl','$dlstate','$property','$employer','$eaddy','$ecity','$estate','$estate','$ezip','$supervisor','$empstartdate','$felony','$creditcard','$cardname','$cardaddress','$cardnum','$pets','$grossincome','$cardexp','$cvv','$cardinit','$fullname','$ref1','$ref1ph','$ref2','$ref2ph','$ssn2','$security','$date','$cphone','','','')") or die(mysql_error());

 

EG.

mysql_query("INSERT INTO `names` (`firstname`, `lastname`) VALUES('$firstname', '$lastname')");

 

James.

Link to comment
https://forums.phpfreaks.com/topic/200788-error-in-php-to-sql/#findComment-1053570
Share on other sites

$queryreg = mysql_query("INSERT INTO application (`fname`,`lname`,`addy`,`city`,`state`,`zip`,`homephone`,`workphone`,`social`,`dob`,`appEmail`,`dlnumber`,`dlstate`,`property`,`employer`, `eaddy`, `ecity`, `estate`, `ezip`, `supervisor`, `estartdate`, `felony`, `creditcard`, `cardname`, `cardaddress`, `cardnum`, `pets`, `grossincome`, `cardexp`, `cvv`, `cardinit`, `fullname`, `ref1`, `ref1phone`, `ref2`, `ref2phone`, `ssn`, `security`, `date`) VALUES ('$fname','$lname','$addy','$city','$state','$zip','$hphone','$wphone','$ssn','$dob','$aemail','$dl','$dlstate','$property','$employer','$eaddy','$ecity','$estate','$estate','$ezip','$supervisor','$empstartdate','$felony','$creditcard','$cardname','$cardaddress','$cardnum','$pets','$grossincome','$cardexp','$cvv','$cardinit','$fullname','$ref1','$ref1ph','$ref2','$ref2ph','$ssn2','$security','$date')") or die(mysql_error());

 

Did that . still error:

Link to comment
https://forums.phpfreaks.com/topic/200788-error-in-php-to-sql/#findComment-1053579
Share on other sites

For the first syntax (without a list of columns), you must supply a value for each column. If you got an error that the column count does not match, check your query to make sure you are supplying the correct number of values. Given that '$fname','$fname' is repeated, I would guess you need to correct the actual list of values.

 

What is the current error you are getting with the second syntax (where you supply a list of the columns you are supplying values for)?

Link to comment
https://forums.phpfreaks.com/topic/200788-error-in-php-to-sql/#findComment-1053580
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.