Something is wrong in your syntax obok ') OR (NOW() BETWEEN pp.start_date AND pp.end_date AND p' w linii 7