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.
Good evening guys,

SITE IN QUESTION: http://www.tokyoghoul.decadence-rpg.net/index.php

I am not having this issue with my forum from my end, however all the rest of my users are. Below is a link to the issue. They can't view the index page, but all other pages of my forum work fine for them.

http://gyazo.com/e219bad96df30f3845f550798c41cf28

I Googled the issue and it appears the fix is different according to the details given. I'm not quite sure where to look for the error or how to fix it and would appreciate help.

When this error occurred for users I didn't add any new plugins, files, change themes or edit templates. I'm stumped.

Thanks so much.
Your query is messed up! Try this one!


$query = $db->query("
	 SELECT t.tid, t.fid, t.subject, t.lastpost, t.lastposter, t.lastposteruid, f.name, u.usergroup, u.displaygroup 
FROM ".TABLE_PREFIX."threads t 
INNER JOIN ".TABLE_PREFIX."forums f ON (f.fid = t.fid) 
LEFT JOIN ".TABLE_PREFIX."users u ON (t.lastposteruid = u.uid) 
WHERE t.fid NOT IN ('20','21','24','25','26','27') AND t.fid NOT IN ('32') AND t.visible = '1'
GROUP BY t.tid ORDER BY t.lastpost DESC LIMIT 8
");
Try disabling all plugins first because that doesn't look like a default query. If I'm not mistaken its for Recent Topics on Index.

ACP->Configuration->General Configuration->Disable All Plugins->set to yes.
(2014-09-19, 01:47 PM)marcus123 Wrote: [ -> ]Your query is messed up! Try this one!


$query = $db->query("
	 SELECT t.tid, t.fid, t.subject, t.lastpost, t.lastposter, t.lastposteruid, f.name, u.usergroup, u.displaygroup 
FROM ".TABLE_PREFIX."threads t 
INNER JOIN ".TABLE_PREFIX."forums f ON (f.fid = t.fid) 
LEFT JOIN ".TABLE_PREFIX."users u ON (t.lastposteruid = u.uid) 
WHERE t.fid NOT IN ('20','21','24','25','26','27') AND t.fid NOT IN ('32') AND t.visible = '1'
GROUP BY t.tid ORDER BY t.lastpost DESC LIMIT 8
");

in a dynamic enviroment how will the query work ? as WHERE t.fid NOT IN ('20','21','24','25','26','27') AND t.fid NOT IN ('32') AND t.visible = '1' could change .. your thoughts ?
(2014-09-19, 01:47 PM)marcus123 Wrote: [ -> ]Your query is messed up! Try this one!



$query = $db->query("
	 SELECT t.tid, t.fid, t.subject, t.lastpost, t.lastposter, t.lastposteruid, f.name, u.usergroup, u.displaygroup 
FROM ".TABLE_PREFIX."threads t 
INNER JOIN ".TABLE_PREFIX."forums f ON (f.fid = t.fid) 
LEFT JOIN ".TABLE_PREFIX."users u ON (t.lastposteruid = u.uid) 
WHERE t.fid NOT IN ('20','21','24','25','26','27') AND t.fid NOT IN ('32') AND t.visible = '1'
GROUP BY t.tid ORDER BY t.lastpost DESC LIMIT 8
");

What do you mean by try this query? I'm not even sure what to do or how to get to this part you speak of.

(2014-09-19, 08:01 PM)dragonexpert Wrote: [ -> ]Try disabling all plugins first because that doesn't look like a default query.  If I'm not mistaken its for Recent Topics on Index.

ACP->Configuration->General Configuration->Disable All Plugins->set to yes.

Yep this fixed the error and it was in the Recent Topics plugin on the index page.

Is there a fix for this or will we permanently have to go without the plugin?
It was last updated back in 2011 and doesn't use templates. I know I had created this same type of thing, except it didn't give SQL errors. I'll see if I still have it.

Edit: I found it, however, the forums to not include are hardcoded and it doesn't install the templates. I'll get it up on the new mods site tomorrow. It will work with both 1.6 and 1.8.
(2014-09-19, 08:32 PM)dragonexpert Wrote: [ -> ]It was last updated back in 2011 and doesn't use templates.  I know I had created this same type of thing, except it didn't give SQL errors.  I'll see if I still have it.

Edit: I found it, however, the forums to not include are hardcoded and it doesn't install the templates.  I'll get it up on the new mods site tomorrow.  It will work with both 1.6 and 1.8.

Thank you so much that would be greatly appreciated! The plugin is amazing and a life safer with a high activity site that needs staff looking at 75% of material posted. Without it it's hard to keep up on recent threads/posts.

Thanks again everyone for you assistance.