Fatal error: Call to a member function insert() on a non-object in ? - 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: Fatal error: Call to a member function insert() on a non-object in ? (/showthread.php?tid=35974) |
Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]anna16[/eluser] Guys I have encountered error in CI 2.0 Code: Fatal error: Call to a member function insert() on a non-object in /home/coder9/public_html/ci2/application/models/membership/membership.php on line 7 and the here is the codes of membership.php Code: <?php thanks in advanced. Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]InsiteFX[/eluser] Hi anna, Did you load the database? You can autoload it in application/config/autoload.php InsiteFX Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]anna16[/eluser] @InsiteFX is this the right command below for autoloading the database? Code: $autoload['database'] = array('auto connect'); Please correct me if I'm wrong. Thanks. Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]tonanbarbarian[/eluser] you have not constructed the class properly Code: class Membership extends Model Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]anna16[/eluser] thanks tonanbarbarian I already did what you said. but i have new error, Code: Fatal error: Class 'CI_Controller' not found in /home/coder9/public_html/ci2/application/controllers/membership/site.php on line 2 Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]Learn CodeIgniter[/eluser] CI 2.0 application/config/autoload.php Code: $autoload['libraries'] = array('database', 'session'); Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]Learn CodeIgniter[/eluser] application/config/config.php Code: /* Add this to the bottom of: application/config/constants.php Code: /* Thanks to the PyroCMS Team for this code! Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]anna16[/eluser] @learn codeigniter I already did what you said, but the problem still the same. Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]anna16[/eluser] okay I'll try your last post. Fatal error: Call to a member function insert() on a non-object in ? - El Forum - 11-17-2010 [eluser]Learn CodeIgniter[/eluser] With that code you will never need to set a base_url again. |