...

View Full Version : Plz Help: Column count doesn't match value count at row 1



gspabla
04-15-2009, 09:59 PM
Error: Could not insert data because Column count doesn't match value count at row 1


I have add new field 'Mobilee' after that when im trying to submit the form i got this error
please help

my code is

// insert the data
$insert = mysql_query("insert into register (Termsofservice,ConfirmEmail,ConfirmPassword,Profilecreatedby,Referenceby,Name,Gender,DOB,Age,TOB,PO B,Maritalstatus,childrenlivingstatus,Education,EducationDetails,Occupation,Employedin,Annualincome,R eligion,Caste,Subcaste,Subcastee,Gothram,Language,Star,Moonsign,Horosmatch,Manglik,Height,Weight,Blo odGroup,Bodytype,Complexion,Diet,Smoke,Drink,Address,City,State,Country,Phone,Mobile,Mobilee,Residen cystatus,Fathername,Mothersname,Fatherlivingstatus,Motherlivingstatus,Fathersoccupation,Mothersoccup ation,Profile,Looking,FamilyDetails,Familyvalues,FamilyType,FamilyStatus,FamilyOrigin,noofbrothers,n oofsisters,nbm,nsm,PE_FromAge,PE_ToAge,PE_HaveChildren,PE_Height,PE_Complexion,PE_MotherTongue,Partn erExpectations,PE_Religion,PE_Caste,PE_Education,PE_Countrylivingin,PE_Residentstatus,Hobbies,OtherH obbies,Interests,OtherInterests,Status,Regdate,IP,Ref,Agent,Orderstatus,photochecklist,videochecklis t,Horoschecklist) values ('".$_SESSION['Accept']."', '".$_SESSION['ConfirmEmail']."', '".$_SESSION['ConfirmPassword']."', '".$_SESSION['ProfileCreatedby']."', '".$_SESSION['Referenceby']."', '".$_SESSION['Name']."', '".$_SESSION['Gender']."', '".$_SESSION['DateofBirth']."', '".$_SESSION['Age']."', '".$_SESSION['Timeofbirth']."', '".$_SESSION['Placeofbirth']."', '".$_SESSION['MaritalStatus']."', '".$_SESSION['ChildrenLivingStatus']."', '".$_SESSION['Education']."', '".$_SESSION['EduDetails']."', '".$_SESSION['eduDetail']."', '".$_SESSION['Occupation']."', '".$_SESSION['Employedin']."', '".$_SESSION['Annualincome']."', '".$_SESSION['Religion']."', '".$_SESSION['Caste']."', '".$_SESSION['SubCaste']."', '".$_SESSION['SubCastee']."', '".$_SESSION['Gothra']."', '".$_SESSION['Mothertongue']."', '".$_SESSION['Star']."', '".$_SESSION['Moonsign']."', '".$_SESSION['HoroscopeMatch']."', '".$_SESSION['Manglik']."', '".$_SESSION['Height']."', '".$_SESSION['Weight']."', '".$_SESSION['BloodGroup']."', '".$_SESSION['Bodytype']."', '".$_SESSION['Complexion']."', '".$_SESSION['Diet']."', '".$_SESSION['Smoke']."', '".$_SESSION['Drink']."', '".$_SESSION['Address']."', '".$_SESSION['City']."', '".$_SESSION['State']."', '".$_SESSION['Country']."', '".$_SESSION['Phone']."', '".$_SESSION['Mobile']."','".$_SESSION['Mobilee']."','".$_SESSION['Residencein']."','".$_POST['txtFANAME']."','".$_POST['txtMONAME']."', '".$_POST['txtFalive']."', '".$_POST['txtMalive']."', '".$_POST['txtFFO']."', '".$_POST['txtFMO']."','".$_POST['txtmsg']."', '".$_POST['txtLooking']."', '".$_POST['txtFD']."','".$_POST['txtFV']."','".$_POST['txtFT']."', '".$_POST['txtFS']."', '".$_POST['txtFO']."','$fs1','$fs2','$nbm','$nsm','".$_POST['Fromage']."','".$_POST['Toage']."', 'NULL', '".$_POST['txtPHeight']."', '".$_POST['txtPComplexion']."','NULL','".$_POST['txtPPE']."', '".$_POST['religion']."', '".$_POST['caste']."','".$_POST['txtPEdu']."', '".$_POST['txtPcountry']."', '".$_POST['txtPReS']."', '".$_POST['txtHobby']."', '".$_POST['txtOh']."','".$_POST['txtInterest']."','".$_POST['txtOi']."','".$_POST['txtstatus']."','".$_POST['txtregdate']."','".$_POST['txtip']."','".$_POST['txtref']."','".$_POST['txtagent']."','$strorderstatus','$strchkcross','$strchkcross','$strchkcross')")

or die("Could not insert data because ".mysql_error());
$uid=mysql_insert_id();

CFMaBiSmAd
04-15-2009, 10:02 PM
The list of columns and the number of data values must match. The error means that your's don't. You need to supply data for each column in the query.

gspabla
04-15-2009, 10:05 PM
can u please explain in more detail
sorry im a newbie in php/mysql

gspabla
04-15-2009, 10:06 PM
sry i forget to say thanx for the very quick reply

Fumigator
04-16-2009, 12:41 AM
An INSERT query contains a list of columns of the table you are going to insert values into, and a list of values you are going to insert into each column. These two lists have to have the same number of items in them.

Alternatively, you can omit the list of column names, but then you have to make sure you specify a value for every column in the table.

gspabla
04-16-2009, 12:44 AM
hmmmmmmmmm....... thank you



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum