Can't perform query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and book_author.haveread = 1  ORDER BY RAND() LIMIT 3' at line 1 

select * from book_author  left join book on book_author.book_id=book.book_id  left join author on book_author.author_id=author.author_id  where book_author.person_id =  and book_author.haveread = 1  ORDER BY RAND() LIMIT 3