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 ') ORDER BY `author2`.`id`' at line 8
SELECT DISTINCT `author2`.`id` AS `id`, `author2`.`name` AS `name` FROM `lessonf` INNER JOIN `author2` ON (`lessonf`.`id_author` = `author2`.`id`) WHERE (`lessonf`.`id_book` = ) ORDER BY `author2`.`id`;