Hello,

I dont know any PHP or MYSQL, but I had created a script for my business with the help of you Gurus.

Now I am stuck with a problem once again. I hope you will help me again.

I have a MYSQL DB, 'shipments' and Table 'info' with a row 'totalprice'

I enter data in totalprice from another page, but now I want record of 'totalprice' to be added and displayed on the a page.

I just want syntax to show SUM of all the records in the 'totalprice' and show as something

Total Cost:

Can you please help?

Recommended Answers

All 3 Replies

Member Avatar for diafol

Have a look at the mysql online manual. It shows how to use the SUM function.

Hi, I know the SUM function but I dont know how to put it in PHP to display the code.

Member Avatar for diafol
$r = mysql_query("...your sql statement...");
while($d = mysql_fetch_array($r)){
  //loop through resultset
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.