Main query [ SELECT sql_calc_found_rows i.*, p.create_time as post_time, i.image_file_id AS selected_image_file_id, f.* FROM image_sets s, image_files f, images i LEFT JOIN post_images p ON p.image_id = i.image_id WHERE (i.image_file_id = f.image_file_id) AND (s.set_id IN ()) AND (s.image_id = i.image_id) GROUP BY i.image_id ORDER BY i.capture_time asc, i.image_id asc LIMIT 4096 OFFSET 0 ] failed: 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 (s.image_id = i.image_id) GROUP BY i.image_id ORDER BY i.c...' at line 13