Jump to content

How to sum rows?


Darkness Soul

Recommended Posts

Yo,

I need a little help, maybe its simple, but i don't know how to do it!

At the index page, I have a table, with cars to be sold! like..

[table][tr][td]id ---[/td][td]36x ---[/td][td]60x ---[/td][/tr][tr][td]1 [/td][td]15[/td][td][/td][/tr][tr][td]1 [/td][td][/td][td]8[/td][/tr][tr][td]2 [/td][td]10[/td][td][/td][/tr][tr][td]3 [/td][td]25[/td][td][/td][/tr][tr][td]3 [/td][td][/td][td]12[/td][/tr][/table]

What I'm suppose to do, to sum these rows, and return something like it?:

[table][tr][td]id ---[/td][td]36x ---[/td][td]60x ---[/td][/tr][tr][td]1 [/td][td]15[/td][td]8[/td][/tr][tr][td]2 [/td][td]10[/td][td][/td][/tr][tr][td]3 [/td][td]25[/td][td]12[/td][/tr][/table]

The data come from 3 tables, using joins.. someone know how i do to simplify this table?

Thank you!!

D.Soul
Link to comment
https://forums.phpfreaks.com/topic/22915-how-to-sum-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.