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 page_link.record_id=snippet.id)=1 AND user_link.record_id=sn...' at line 10