My table value is:
id stock 1 7|8 2 80|50|30 and 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