Database error

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 n.id = nc.connected_id WHERE n.active = '1' GROUP BY n.id ORDER BY n.ontop d' at line 3