データベースで計算してみませんか?
SELECT SUM(price * sold) as total
FROM `inv`;
編集:
SELECT SUM((replace(price, '$', '') + 0) * sold) as total
FROM `inv`;
データベースで計算してみませんか?
SELECT SUM(price * sold) as total
FROM `inv`;
編集:
SELECT SUM((replace(price, '$', '') + 0) * sold) as total
FROM `inv`;