Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP & MySQL Calculations

Explorer ,
Apr 26, 2008 Apr 26, 2008
Hi, I was wondering if anyone could take the time to mull over this and maybe put me in the right direction,

I have a database with a students tabel, and there is a field for 'score'.

I have managed to display all the students merit scores in a table (I cheated and used Dreamweaver for this)

I want to add a row at the bottom of the table that adds up all the scores.

I am finding this hard as I have just put a repeat region around the {teachers_students.merit} field.

Could anyone help me out with calculating these total?

Thanks in advance.
If you know of a site that helps with this please post.
TOPICS
Server side applications
276
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2008 Apr 27, 2008
LATEST
godonholiday wrote:
> Hi, I was wondering if anyone could take the time to mull over this and maybe
> put me in the right direction,
>
> I have a database with a students tabel, and there is a field for 'score'.
>
> I have managed to display all the students merit scores in a table (I cheated
> and used Dreamweaver for this)
>
> I want to add a row at the bottom of the table that adds up all the scores.
>
> I am finding this hard as I have just put a repeat region around the
> {teachers_students.merit} field.
>
> Could anyone help me out with calculating these total?
>
> Thanks in advance.
> If you know of a site that helps with this please post.
>
I would create a second query in mysql:

select SUM(columnName) from tableName;

The same thing can be done using PHP or javascript, but the mysql
operation would be simpler.

Mick.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines