My table value is:

id stock1 7|82 80|50|30and my query is
I used PHP function

function numofQuantity() { $sql = "SELECT sum(stock) as quantity FROM products"; $result = dbQuery($sql); $data=mysql_fetch_assoc($result); return $data['quantity'];}Here it shows the result is 87.
How to sum all the values? Thank you


Check Solution