Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-15-2009, 08:59 PM   PM User | #1
gspabla
New Coder

 
Join Date: Apr 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
gspabla is an unknown quantity at this point
Plz Help: Column count doesn't match value count at row 1

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
PHP Code:
// insert the data
$insert mysql_query("insert into register (Termsofservice,ConfirmEmail,ConfirmPassword,Profilecreatedby,Referenceby,Name,Gender,DOB,Age,TOB,POB,Maritalstatus,childrenlivingstatus,Education,EducationDetails,Occupation,Employedin,Annualincome,Religion,Caste,Subcaste,Subcastee,Gothram,Language,Star,Moonsign,Horosmatch,Manglik,Height,Weight,BloodGroup,Bodytype,Complexion,Diet,Smoke,Drink,Address,City,State,Country,Phone,Mobile,Mobilee,Residencystatus,Fathername,Mothersname,Fatherlivingstatus,Motherlivingstatus,Fathersoccupation,Mothersoccupation,Profile,Looking,FamilyDetails,Familyvalues,FamilyType,FamilyStatus,FamilyOrigin,noofbrothers,noofsisters,nbm,nsm,PE_FromAge,PE_ToAge,PE_HaveChildren,PE_Height,PE_Complexion,PE_MotherTongue,PartnerExpectations,PE_Religion,PE_Caste,PE_Education,PE_Countrylivingin,PE_Residentstatus,Hobbies,OtherHobbies,Interests,OtherInterests,Status,Regdate,IP,Ref,Agent,Orderstatus,photochecklist,videochecklist,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(); 

Last edited by gspabla; 04-15-2009 at 09:01 PM.. Reason: forgot to subscript thread
gspabla is offline   Reply With Quote
Old 04-15-2009, 09:02 PM   PM User | #2
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,744
Thanks: 2
Thanked 255 Times in 247 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
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.
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
CFMaBiSmAd is offline   Reply With Quote
Old 04-15-2009, 09:05 PM   PM User | #3
gspabla
New Coder

 
Join Date: Apr 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
gspabla is an unknown quantity at this point
sorry

can u please explain in more detail
sorry im a newbie in php/mysql
gspabla is offline   Reply With Quote
Old 04-15-2009, 09:06 PM   PM User | #4
gspabla
New Coder

 
Join Date: Apr 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
gspabla is an unknown quantity at this point
sry i forget to say thanx for the very quick reply
gspabla is offline   Reply With Quote
Old 04-15-2009, 11:41 PM   PM User | #5
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,687
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
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.
__________________
Fumigator is offline   Reply With Quote
Old 04-15-2009, 11:44 PM   PM User | #6
gspabla
New Coder

 
Join Date: Apr 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
gspabla is an unknown quantity at this point
hi

hmmmmmmmmm....... thank you
gspabla is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:39 PM.


Advertisement
Log in to turn off these ads.