CodeIgniter Forums
Message: Undefined property: options_controller::$db =error - 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: Message: Undefined property: options_controller::$db =error (/showthread.php?tid=46548)



Message: Undefined property: options_controller::$db =error - El Forum - 11-05-2011

[eluser]bill19[/eluser]
Hi everyone,

I have the following code:

Code:
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class op_controller extends CI_Controller {

public function index()
{
  
          

                
                if ($this->db->table_exists('zp'))
{
                    echo "zp exists";
}

I am getting : A PHP Error was encountered

Severity: Notice

Message: Undefined property: op_controller::$db

followed by:

Quote:Fatal error: Call to a member function table_exists() on a non-object in C:\wamp\www\options1101\application\controllers\op_controller.php

At present the table does not exist. Any ideas?

KC