MyBB Community Forums

Full Version: SQL Error 1064
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone tell me what this error means in english:
Quote:SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '18, 22, 26, 27, 28, 32, 40, 70, 71, 74)' at line 1
Query:
SELECT COUNT(tid) AS newann FROM mybb_threads WHERE visible=1 AND dateline>'1286093995' AND fid IN (4,5,6,13,14, 16. 18, 22, 26, 27, 28, 32, 40, 70, 71, 74)
It comes when someone logs in when my sideboxes are activated. The error seems random to me.

Best Regards
If deactivating the sideboxes plugin fixes it, then that is obviously a plugin problem. Nothing we can do to help really.
I just need someone to explain the error to me. All the codes of the sideboxes were taken from portal.php

I am MySQL 100% n00b
The problem is in the sql call here:

4,5,6,13,14, 16. 18,

SQL is expecting there to be a coma after 16 but theres a period. Check in the code where that sql query is located as to why a period is getting inserted.
You're putting the value from the settings directly into the query. Not only do you need to escape this, you'll need to check that a valid value has been put in.