$sql = "SELECT SUM(COST) sum FROM LIST";$res = mysql_query($sql);$row = mysql_fetch_assoc($res);echo $row['sum'];