![]() |
help noob with select_sum - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: help noob with select_sum (/showthread.php?tid=48762) |
help noob with select_sum - El Forum - 01-27-2012 [eluser]xxIdroxx[/eluser] Hello everyone, I'm a beginner with CodeIgniter and I need to select a field to a table and add up all the data I can find. I tried to do this script but it goes: Code: $query = $this->db->get_where($this->session->userdata('universe').'_alleanza_utenti', array('ally_id' => $param5)); help noob with select_sum - El Forum - 01-27-2012 [eluser]vbsaltydog[/eluser] From the user guide: Quote: You are calling the select_sum() method of the db class after you run your query using get_where() which is wrong. help noob with select_sum - El Forum - 01-27-2012 [eluser]xxIdroxx[/eluser] how do I do? help noob with select_sum - El Forum - 01-27-2012 [eluser]vbsaltydog[/eluser] I don't do it for you, I only point the way. Look into OOP basics and the answer will be clear. help noob with select_sum - El Forum - 01-27-2012 [eluser]xxIdroxx[/eluser] I followed the user guide but I can not do the sum runs help noob with select_sum - El Forum - 01-28-2012 [eluser]xxIdroxx[/eluser] up help me please help noob with select_sum - El Forum - 01-28-2012 [eluser]smilie[/eluser] Just read once more what vbsaltydog said; Let me give you a hint: [quote author="vbsaltydog" date="1327693579"]From the user guide: Quote: You are calling the select_sum() method of the db class after you run your query using get_where() which is wrong. [/quote] So, hints: - after; - code vbsaltydog already posted from user guide... MegaHint of the day: 'before' ;-) Cheers, Smilie help noob with select_sum - El Forum - 01-28-2012 [eluser]xxIdroxx[/eluser] i have tried but it doesn't work if i use where or get_where help noob with select_sum - El Forum - 01-28-2012 [eluser]Bhashkar Yadav[/eluser] simple way, you can pass your whole query into $this->db->query("SELECT ......."); like : Code: $rs = $this->db->query("SELECT ......."); |