[SOLVED] library question so simple/noob you'll be proud to answer me ... - 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: [SOLVED] library question so simple/noob you'll be proud to answer me ... (/showthread.php?tid=9528) Pages:
1
2
|
[SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]Dagobert Renouf[/eluser] Hi guys, My library : Code: public function __construct() it says db is not defined, why is that ? (I load the database in the constructor) [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]Seppo[/eluser] CI does not attach the db object to all libraries... you should use Code: $CI =& get_instance(); [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]ontguy[/eluser] I think it should setup like this: Code: var $CI; [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]Dagobert Renouf[/eluser] ahah I thought it would be simpler than that : Seppo : same error ontguy : "Call to a member function table_exists() on a non-object" [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]ontguy[/eluser] What version of php are you working with? [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]Dagobert Renouf[/eluser] PHP Version 5.2.6 [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]ontguy[/eluser] Does anything from the url helper work in that function? try Code: echo base_url(); If it works, the CI reference was passed successfully to the library. [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]Dagobert Renouf[/eluser] yes it does work [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-28-2008 [eluser]xwero[/eluser] Try loading the database in the method [SOLVED] library question so simple/noob you'll be proud to answer me ... - El Forum - 06-29-2008 [eluser]Dagobert Renouf[/eluser] still the same :-s Call to a member function database() on a non-object |