Sum all values retrieve from fetch on mysql fetch array (html/php/database)

I have a code to fetch data from database query using mysqli_fetch_array I just want to sum all values on a particular data(Price) into Total Amount.

========Supposed I have 2 data inserted
Array result look like this:

Title: A
Price: 10

Title: B
Price: 30

Total Amount: (This is my problem)

=========