Sorgu içinde işlem yapmayıp değişkene değer alacak isem ? kullanırım:
Örn: $sayi = $a > $b ? $a : $b;