select * from siparis where onay = '$onay' order by id desc

sorgunu böyle değiştirirmisin order group by şartlardan sonra yazılır