![]() |
I need help - 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: I need help (/showthread.php?tid=37459) |
I need help - El Forum - 01-10-2011 [eluser]rudejason[/eluser] I have only started using Codeigniter and i love it! I have found that in my controllers i am using the same functions over and over. So i thought build a custom library and then i can use that. here is my code Code: class Mygeodata when i run this it gives me this error... Call to a member function query() on a non-object what am i doing wrong? Thank you in advance! I need help - El Forum - 01-11-2011 [eluser]Atharva[/eluser] It will be Code: $this->CI->db->query I need help - El Forum - 01-11-2011 [eluser]rudejason[/eluser] Thanks but still no go i have tried Code: $this->CI->db->query() Code: $CI->db->query() Severity: Notice Message: Undefined variable: CI Filename: libraries/Mygeodata.php Line Number: 15 I need help - El Forum - 01-11-2011 [eluser]Atharva[/eluser] Try Code: $this->CI =& get_instance(); in constructor. I missed it earlier. I need help - El Forum - 01-11-2011 [eluser]rudejason[/eluser] That was it, Thank you so much! Gonna save me a lot of time retyping all the functions for each controller!!!!! Thanks Again! |