perchč questa non nč ok?

select * from fattprod.
where nfattura=$righe.
order by id_fattprod desc limit 0,1;