"Column count doesn't match value count at row 1"

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mohson
Forum Contributor
Posts: 372
Joined: Thu Dec 02, 2004 6:58 am
Location: London

"Column count doesn't match value count at row 1"

Post by mohson »

Can anyone see anything wrong with this insert statement there are 19 coloms and 19 values being inserted but I am getting message saying "Column count doesn't match value count at row 1"

Code: Select all

PRINT $sql = "INSERT INTO feedbackcontacts 
   ( 
   salutation, name, surname, organisation, email,address,address1, 
   telephonefax, mobile, mscints, mscactive,otheractivities, 
   gradjobs, ugproj, pdev, bcsmem, bcspds, 
   teach, acconsult, person_id
   ) 
VALUES 

    ( 
    '$salutation','$name','$surname','$organisation','$email','$address',
	'$address1', '$telephonefax', '$mobile','$mscints','$mscactive','$otheractivities'
    '$gradjobs', '$ugproj', '$pdev','$bcsmem','$bcspds','$teach', 
    '$acconsult','$person_id'
    )";
Please help
Last edited by mohson on Mon Jul 17, 2006 12:16 pm, edited 1 time in total.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you're missing a comma after other activities in your values section.
mohson
Forum Contributor
Posts: 372
Joined: Thu Dec 02, 2004 6:58 am
Location: London

Post by mohson »

Thank you so much Burrito, Im so tired I missed it. Really do appreciate the quick response your a life saver!!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

This is two threads I've had to move today of yours, mohson, from PHP Code to Databases. Please think more carefully about where you post.
Post Reply