$sorgu = mysql_query("SELECT fiyat*adet as sattigim FROM satilanlar"); while($z= mysql_fetch_array($sorgu)) { $toplam +=$z[sattigim]; } echo $toplam;