I simply need to sum the value of about 15 columns (say, 20-35) in codeigniter.
What's the best way to do this?
I simply need to sum the value of about 15 columns (say, 20-35) in codeigniter.
What's the best way to do this?
Do it exactly the same way you would in plain SQL. If MySQL then you can do this:
$this->db->select('SUM(field1) + SUM(field2) + SUM(field3) as total', FALSE);
The FALSE stops auto-escaping.
I am looking for same answer where i need a loop till specific node position() and sum of till.
i.e.
if my position is 2 then sum of node[1] + node [2] and if my position is increased to 5 then node[1] + node [2] + node[3] + node [4] + node[5]
what will be xsl
thanks in advanced Kedar Vijay Kulkarni