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

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

Jump to Post

All 3 Replies

Member Avatar

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
$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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.