I’ve counted, checked my commas, and went over the whole thing again but I still can’t find what is causing this error. It is telling me that I’m trying to put more information in than I’ve given column names for, but I have 29 columns and 29 values. There are no missing commas that I can see.
Could someone give this a glance over and see if there is anything that I’m missing?
$query = <<<EOD
insert into roster
(conference, regtime, participanttype_id, category_id, title,
firstname, lastname, badgename, jobtitle, department,
organization, address1, address2, address3, city,
state, country, postal, email, phone,
fax, paytype, feedue, f01, yn01,
yn02, yn03, yn04, other)
values
('event1023', now(), $sfund_partictype_id, $sfund_category_id, '$title',
'$firstname', '$lastname', '$badgename', '$jobtitle', '$deptname',
'$organization', '$address1', '$address2', '$address3', '$city',
'$state', '$country', '$postal', '$email', '$phone',
'$fax', '$paytype', $feedue, '$wedsession', '$yn01',
'$yn02', '$yn03', '$yn04', '$other')
EOD;
ETA: I’ve spaced this out like this because past critiques of my posts suggest that I should do so. It’s not like this in my code though.
ETA #2: Here’s the weird thing. The values go into the database perfectly. but it still returns this (and also made me realize that EEK MY CODE IS SHOWING EXACT ERRORS, so as an aside, yes I will fix that before it goes live):
Query failed:
insert into roster
(conference, regtime, participanttype_id, category_id, title,
firstname, lastname, badgename, jobtitle, department,
organization, address1, address2, address3, city,
state, country, postal, email, phone,
fax, paytype, feedue, f01, yn01,
yn02, yn03, yn04, other)
values
('event1023', now(), 3, 14, 'Ms',
'Jane','Smith','Jane Smith', 'Developer', 'my dept',
'my organization', 'my address', '','','my city',
'NC','United States','55555','me@email.edu','555-555-5555',
'', 'CHECK', 225, '2', '1',
'0', '1', '0', 'n/a')
Column count doesn't match value count at row 1
My lesson for the week: go check with IT to make sure that there isn’t something else happening on a more global basis…don’t just assume your code is incorrect.
Thank you for all trying to help me figure this out- next time I will call the IT guys instead of troubleshooting for far too long.