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 ') order by lastmsg DESC Limit 0, 20' at line 5
SQL: select SQL_CALC_FOUND_ROWS id,linkid,what as note,title,stop as closed,name as username,usercolor,userid,image,hits,answers,lastid, UNIX_TIMESTAMP(lastmsg) as messagetime,created as time_created, date_format(lastmsg,"%d.%m.%Y %H:%i") as lastmsgg,message_times,message_ids, lastname,lastuserid, forum,locate(',,',namesread) as hasread,FIND_IN_SET('',active_userids) as hasownposts,active_userids as activeusers,answered from forum_threads where board='103' && id in () order by lastmsg DESC Limit 0, 20