Por que não fazer o cálculo no banco de dados?
SELECT SUM(price * sold) as total
FROM `inv`;
EDITAR:
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`;