CodeIgniter Forums

Full Version: Message: Undefined property: options_controller::$db =error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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