How to totalize a column and display it in the header section of the page

QuestionsHow to totalize a column and display it in the header section of the page
Tony Wolsey asked 1 year ago

Hello

I am sure this is a simple task but I am struggling to make it work. Is there a simple way to totalize a mysql column and display it in the header section of the page?

$result = $g->execute_query(“SELECT SUM(quantity) as s FROM tblestimate where projectnumberest = ‘110902618’”);

thank you

Tony

2 Answers
Abu Ghufran Staff answered 1 year ago

You can call:

$rs = $g->get_one(“SELECT SUM(quantity) as s FROM tblestimate where projectnumberest = ‘110902618’”);
$opt[“caption”] = “Sample Grid – “. $rs[“s”];

where $g is new jqgrid() and $opt is variable passed to set_options($opt)

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Tony Wolsey answered 1 year ago

thank you Abu

Your Answer

2 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?