In mysql client the query with this condition work fine, but when put this query in php page, not work:
The variable are $_REQUEST:
SELECT * FROM table_name
WHERE 1=1
AND idbook = '$idbook'
AND book_year between coalesce('$year',book_year ) and coalesce('$year',book_year )
If remove this line AND book_year between coalesce('$year',book_year ) and coalesce('$year',book_year )
, the query work fine.
How to resolve it?