MyBB Community Forums

Full Version: Can't Delete Posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When trying to delete a post, we get the below message. We are able to delete threads, move posts, edit posts. The only issue appears to be when deleting posts. I have tried to search for an answer but have not been able to find anything matching what we are getting.

MyBB has experienced an internal SQL error and cannot continue.

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 ') AND pid != 65516' at line 2

Query: SELECT distinct uid from mybb_posts WHERE tid=28) AND pid != 65516


It does appear that this may be an issue with a plugin, when I disabled the plugin I could delete posts and as soon as I allowed it back I couldn't.

thank you
Yes, a plugin has a malformed query: the closing parenthesis must not be present.
Probably because the creator first use a in clause.

Which plugins are you using ? We can't find the faulty one with a cristal ball Smile
https://github.com/amwelles/mybb-threadlog

We ended up loading an older version of the plugin and it fixed the problem.
Ok, error found @ https://github.com/amwelles/mybb-threadl...g.php#L284
WHERE tid={$post['tid']}) AND pid != {$pid}"); must be WHERE tid={$post['tid']} AND pid != {$pid}");

The code confirms what I was thinking, it has multiple updates done too fast, or by different pple:
 LEFT JOIN `{$db->table_prefix}threads` as t on t.tid=e.tid
            left join `".$db->table_prefix."threadprefixes` as p on p.pid = t.prefix
            LEFT JOIN `{$db->table_prefix}forums` as f on f.fid=t.fid
Looks like 2 persons write that Smile
Thank you!