The error description: SQLSTATE[42000]: Syntax error or access violation: 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 T.group_id=L.group_id AND T.topic_id=L.topic_id AND T.last_reply>L.last_r' at line 1