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

08-24-2006, 03:51 AM
Hi All

I am getting the following error when I run my query.

Column count doesn't match value count at row 1

I have looked up this error and have checked and I appear to have the right number and names in my query. In the DB table I have 34 columns, and that is what I have in the query.

The last 4 in the query are for the names of the images being uploaded, but am not sure how this all works, so I don't know if I need them, but have them there until I know for sure. Comment, Purchase and Remarks are not used in this form, but I have added them so everything is being shown in the query.

Here is the query itself.

mysql_query ("Insert into `workorder`(ID,Work, Sched, Name, Site, Serial, Hours,
Starts, Issue, Severity, Resolution, Assistance, NumberA, PartsA, NumberB,
PartsB, NumberC, PartsC, NumberD, PartsD, NumberE, PartsE, NumberF, PartsF,
NumberG, PartsG, Safety, Comment , Purchase , Remarks , Upload1, Upload2, Upload3, Upload4) VALUES
('', '$Work', '$Sched', '$Name', '$Site', '$Serial', '$Hours', '$Starts',
'$Issue', '$Severity', '$Resolution', '$Assistance', '$NumberA', '$PartsA',
'$NumberB', '$PartsB', '$NumberC', '$PartsC', '$NumberD', '$PartsD',
'$NumberE', '$PartsE', '$NumberF', '$PartsF', '$NumberG', '$PartsG',
'$Safety', '$Comment', '$Purchase', '$Remarks', '$Upload1', '$Upload2,' '$Upload3', '$Upload4')")
or die(mysql_error());

08-24-2006, 04:13 PM
Is it possible that some of the data you're putting into your query is corrupting the query? If your php variables have apostrophese in them, you'll run into trouble. Try echoing the query and analyzing it.