Page 1 of 1

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

Posted: Mon Jul 17, 2006 12:14 pm
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

Posted: Mon Jul 17, 2006 12:16 pm
by Burrito
you're missing a comma after other activities in your values section.

Posted: Mon Jul 17, 2006 12:25 pm
by mohson
Thank you so much Burrito, Im so tired I missed it. Really do appreciate the quick response your a life saver!!!

Posted: Mon Jul 17, 2006 12:47 pm
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.