# Getting sum of MySQL-fields?

**URL:** <https://forum.kirupa.com/t/getting-sum-of-mysql-fields/107240>\
**Category:** Uncategorized\
**Created:** [April 13, 2004, 4:36pm UTC](https://forum.kirupa.com/t/getting-sum-of-mysql-fields/107240 "2004-04-13T16:36:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScriptFlipper](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@ScriptFlipper](https://forum.kirupa.com/u/ScriptFlipper)\
**Post date:** [April 13, 2004, 4:36pm UTC](https://forum.kirupa.com/t/getting-sum-of-mysql-fields/107240/1 "2004-04-13T16:36:11Z")

</div>

I have a table in a MySQL database where one field contains only numbers.  
Now I want to pull the sum of those numbers out from the database via PHP. How does one do that?? I’ve tried many different things, but I can’t get it to work.

Let’s say this is the table:

```auto

+--------+
| number |
+--------+
| 1 |
| 2 |
| 3 |
+--------+

```

How can I get the result from the database to be 6 (1+2+3) ?

Thanks  
Johan aka kalliban
