![]() |
Undefined Variable when loading a database? - 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: Undefined Variable when loading a database? (/showthread.php?tid=14430) |
Undefined Variable when loading a database? - El Forum - 01-02-2009 [eluser]Solarpitch[/eluser] Hey, When I try to call the test function in the below model, I get the error... Severity: Notice Message: Undefined variable: callan_db Filename: models/report_model.php Dont really understand considering the variable is defined and I've set up the callan database connection settings correctly. Code: class Report_model extends Model { Undefined Variable when loading a database? - El Forum - 01-02-2009 [eluser]Armchair Samurai[/eluser] You haven't defined $callan_db for the entire class, just the constructor. You'll need to do this: Code: class Report_model extends Model { Undefined Variable when loading a database? - El Forum - 01-02-2009 [eluser]Solarpitch[/eluser] I see... I tried... $callan_db = ""; but that didnt work. I wasnt aware you needed to include $this-> before the variable either. |