Jump to content

another question - counting values of rows in a database


Kitkat

Recommended Posts

Hello again.. I'm building an infractions system (similar to most forum "warn" systems) and I want to actually count up the values of each row. I'm not exactly sure to do that.

 

So for instance say we had this:

 

`id`, `userid`, `infractamount`

 

And I pulled the rows

 

`1`, `5`, `2`

`2`, `5`, `3`

 

Is there any way I can add those up to 5 from ONE QUERY? I know very well how to do it out of MySQL but I would like to know if there's a shortcut.

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.