- Posts: 60
COMMUNITY FORUM
Error: 1136 Column Count Doesn't Match Value Count
- Wire Creative
-
Topic Author
- Offline
- Senior Member
After running that update, the site seemed fine until I logged out and tried to login again later. Now when I log in to the admin area, I get this error:
An error has occurred.
1136 Column count doesn't match value count at row 1 SQL=INSERT INTO hmwmh_user_usergroup_map (user_id,group_id) VALUES (549),(7)
There appears to be a syntax error which is writing "(549),(7)" instead of "(549,7)".
I've searched the site files and I think I may have found the offending bit of code in the file "administrator/components/com_k2/models/users.php" but I'm not smart enough to parse it correctly.
Here's line 420:
$query = "INSERT INTO #__user_usergroup_map VALUES (".$id.", ".implode("), (".$id.", ", $group).")";
Is the syntax on that last part correct, or could it be causing this error? It loses me at "implode" but it looks like the nesting may be off or there may be one too many commas.
I also updated K2 during this same work session, so it's possible it could be K2-related. Apologies in advance if I'm barking up the wrong tree here.
Thanks,
Greg
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Moderator
- Posts: 8743
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Wire Creative
-
Topic Author
- Offline
- Senior Member
- Posts: 60
Lefteris Kavadas wrote: Hi. You need to check from what file the error comes from. The query in K2 model is being executed only when you try to move a user to some other user group, so probably the issue is somewhere else. Go to "Extensions" -> "Extension Manager" and then click "Database" from the sidebar. If there are warnings there click the Fix button.
Unfortunately this error is locking me out of the entire admin area. It happens immediately after logging in and makes all other admin pages inaccessible.
I searched all the Joomla files for INSERT queries on the user_usergroup_map table. I found two: the one in this K2 user.php file and another in the admin files for the core users component. I can't follow the thread on the latter, but I know it's the more likely culprit.
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Moderator
- Posts: 8743
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.