/    Sign up×
Community /Pin to ProfileBookmark

Column count doesn’t match value count at row 1

Hi There,

From what I have read the ‘Column count doesn’t match value count at row 1’ error is common and easy to troubleshoot? Yet I cannot find my issue!!

I have take files which were created years ago and started to modify them to my needs, now i’m sure I have probably just deleted or added something in the incorrect place.

There are many files that create this plugin but from what I have read it’s the MySQL Queries that cause this error, so below I have quoted queries from all the files!

Hope someone can help!!

File 1

[code]Line 141: $mysql_query = “REPLACE INTO $mysql_table (id,gamename,gametype,league,tag1,tag2,team1,team2,ground,sides,scores1,scores2,result,players1,players2,contact,website,rules,info,screenshots,demos,calendar,timestamp) VALUES (‘$form[id]’,’$form[gamename]’,’$form[gametype]’,’$form[league]’,’$form[tag1]’,’$form[tag2]’,’$form[team1]’,’$form[team2]’,’$form[ground]’,’$form[sides]’,’$form[scores1]’,’$form[scores2]’,’$form[result]’,’$form[players1]’,’$form[players2]’,’$form[contact]’,’$form[website]’,’$form[rules]’,’$form[info]’,’$form[screenshots]’,’$form[demos]’,’$form[calendar]’,’$form[timestamp]’)”;[/code]

File 2

[code]Line 205: $mysql_query = “REPLACE INTO “.MPREFIX.”$cal_event (event_id,event_title) VALUES (”,’PLACE HOLDER’)”;[/code]

[code]Line 212: $mysql_query = “REPLACE INTO $mysql_table (id,gamename,gametype,league,tag1,tag2,team1,team2,ground,sides,scores1,scores2,result,players1,players2,contact,website,rules,info,screenshots,demos,calendar,timestamp) VALUES (‘$form[id]’,’$form[gamename]’,’$form[gametype]’,’$form[league]’,’$form[tag1]’,’$form[tag2]’,’$form[team1]’,’$form[team2]’,’$form[ground]’,’$form[sides]’,’$form[scores1]’,’$form[scores2]’,’$form[result]’,’$form[players1]’,’$form[players2]’,’$form[contact]’,’$form[website]’,’$form[rules]’,’$form[info]’,’$form[screenshots]’,’$form[demos]’,’$form[calendar]’,’$form[timestamp]’)”;[/code]

[code]Line 248: $mysql_query = “REPLACE INTO “.MPREFIX.”$cal_event (event_id,event_start,event_end,event_datestamp,event_title,event_location,event_details,event_author,event_category) VALUES (‘$form[calendar]’,’$form[timestamp]’,’$form[timestamp]’,’$rwar_id’,’$calendar_title’,’$calendar_subject’,’1.RWar’,’$rwar_calendar_category’)”;[/code]

[code]Line 335: $mysql_query = “SELECT * FROM $mysql_table WHERE id = ‘$_GET[id]’ LIMIT 1”;[/code]

File 3

[code]Line 107: $mysql_query = “REPLACE INTO $mysql_table (id,gamename,gametype,league,tag1,tag2,team1,team2,ground,sides,scores1,scores2,result,players1,players2,contact,website,rules,info,screenshots,demos,calendar,timestamp) VALUES (‘$mysql_row[id]’,’$mysql_row[gamename]’,’$mysql_row[gametype]’,’$mysql_row[league]’,’$mysql_row[tag1]’,’$mysql_row[tag2]’,’$mysql_row[team1]’,’$mysql_row[team2]’,’$mysql_row[ground]’,’$mysql_row[sides]’,’$mysql_row[scores1]’,’$mysql_row[scores2]’,’$mysql_row[result]’,’$mysql_row[players1]’,’$mysql_row[players2]’,’$mysql_row[contact]’,’$mysql_row[website]’,’$mysql_row[rules]’,’$mysql_row[info]’,’$mysql_row[screenshots]’,’$mysql_row[demos]’,’$mysql_row[calendar]’,’$mysql_row[timestamp]’)”;[/code]

File 4

[code]Line 86: $mysql_query = “REPLACE INTO $mysql_table (id,gamename,gametype,league,tag1,tag2,team1,team2,ground,sides,scores1,scores2,result,players1,players2,contact,website,rules,info,screenshots,demos,calendar,timestamp) VALUES (‘$mysql_row[id]’,’$mysql_row[gamename]’,’$mysql_row[gametype]’,’$mysql_row[league]’,’$mysql_row[tag1]’,’$mysql_row[tag2]’,’$mysql_row[team1]’,’$mysql_row[team2]’,’$mysql_row[ground]’,’$mysql_row[sides]’,’$mysql_row[scores1]’,’$mysql_row[scores2]’,’$mysql_row[result]’,’$mysql_row[players1]’,’$mysql_row[players2]’,’$mysql_row[contact]’,’$mysql_row[website]’,’$mysql_row[rules]’,’$mysql_row[info]’,’$mysql_row[screenshots]’,’$mysql_row[demos]’,’$mysql_row[calendar]’,’$mysql_row[timestamp]’)”;[/code]

If it helps further I can also post all of the original queries before I modified any of it!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 10.2012 — Count how many columns are listed in the first set of parentheses, then compare that to the number of values in the parentheses following the "VALUES" keyword. If the counts are not the same, then there's your problem. It may help to echo out the query string variable so that you can see what it looks like once the variables are evaluated.
Copy linkTweet thisAlerts:
@BenWaltersauthorAug 11.2012 — Thanks, I thought that that may have been the case so I went back to the original and compared them. During a mass deleting of a lot of fields I removed one of the values!! I have now removed the table field and all is working ?

Just incase anyone was looking and wondering which one was actually incorrect it was this one -
Line 248: $mysql_query = "REPLACE INTO ".MPREFIX."$cal_event (event_id,event_start,event_end,event_datestamp,event_title,[b]event_location[/b],event_details,event_author,event_category) VALUES ('$form[calendar]','$form[timestamp]','$form[timestamp]','$rwar_id','$calendar_title','$calendar_subject','1.RWar','$rwar_calendar_category')";

It was the event_location that didn't match up with a value!

Sorry but Thanks ?
×

Success!

Help @BenWalters spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...