MyBB Community Forums

Full Version: MyBB SQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello I got an error message when I try to access a forum. All of the treads and other forums work fine except one

MyBB SQL Error

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 MariaDB server version for the right syntax to use near ') AND visible IN (1,-1,0)' at line 1

Query:
SELECT DISTINCT tid,uid FROM mybbwe_posts WHERE uid='1' AND tid IN (18,19,706,663,32,163,365,451,177,397,154,243,193,72,21,) AND visible IN (1,-1,0)



Link to the forum that gives this error
https://www.ironmaiden-bg.com/forum/foru...php?fid=19

The forum installation is new but the database is from an old V Bulletin board and imported.
Everything else seems to work ok except this forum
I searched the forum for similar issues but no luck
hi, your query has one extra comma :
change this :

SELECT DISTINCT tid,uid FROM mybbwe_posts WHERE uid='1' AND tid IN (18,19,706,663,32,163,365,451,177,397,154,243,193,72,21,) AND visible IN (1,-1,0)

to :
 SELECT DISTINCT tid,uid FROM mybbwe_posts WHERE uid='1' AND tid IN (18,19,706,663,32,163,365,451,177,397,154,243,193,72,21) AND visible IN (1,-1,0)
Hello ... im not quite fammiliar. Where should I change this?
you must check your plugin files coding to fix this because mybb dont have issues like this and if you not fammiliar with php coding you must Get help from other users .
some peaple do it for free some non-free like me.

if you want you can order to me as fixing order (non-free) .

Telegram : @MostafaShiraali
Discord : MostafaShiraali#7754
If you have plugins enabled, try to disable all of them and check if the error is alway present.
If no, re-enable plugins one per one and check to find the culpry. Then, indicate us wich plugin throwes this error and we may found the solution.
(2022-09-07, 02:26 PM)Crazycat Wrote: [ -> ]If you have plugins enabled, try to disable all of them and check if the error is alway present.
If no, re-enable plugins one per one and check to find the culpry. Then, indicate us wich plugin throwes this error and we may found the solution.

I tried that. Disabling them one by one and all of them. The error is still there
I don't seem to have any issue loading the page you linked.

Best I can guess is that this issue is stemming from the threadcache for doticon (participation indicator for user).

See if your forumdisplay.php file matches the below maybe?

forumdisplay.php (line 884)
$tids = $threadcache = array();

forumdisplay.php (line 964)
if(!empty($tids))
{
 $tids = implode(",", $tids);
}

// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != 0 && $mybb->user['uid'] && !empty($threadcache))
{
 $query = $db->simple_select("posts", "DISTINCT tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids}) {$visibleonly}");
 while($post = $db->fetch_array($query))
 {
 if(!empty($moved_threads[$post['tid']]))
 {
 $post['tid'] = $moved_threads[$post['tid']];
 }
 if($threadcache[$post['tid']])
 {
 $threadcache[$post['tid']]['doticon'] = 1;
 }
 }
}

If the above isn't the issues its probably caused by a plugin.