Question: I'm trying to insert demo records from some simple form using active records and codeigniter

```
function create_httpPost()
{
   $data = array(
      'title' => $this->input->post('title'),
      'content' => $this->input->post('content')
   );

   $this->newsModel->createData($data); //error occures here
   $this->index();//aka redirectToAction
}

```

but after posting form I'm getting following error

> 
> \*\*Message: Undefined property: News::$newsModel
> 
> 
> Filename: controllers/news.php Line Number: 29\*\*
> 
> 
> 

Inside model I have this method

```
function createData($data)
    {
        $this->db->insert('News', $data);
        return;
    }

```

what I'm doing wrong here?

Answer: 
According to the CodeIgniter documentation, model class names must begin by an upper case letter with the rest of the name being lower case.

See: <http://ellislab.com/codeigniter/user-guide/general/models.html>

In the section titled **Anatomy of a Model:**

> 
> Class names must have the first letter capitalized with the rest of the name lowercase...
>  The file name will be a lower case version of your class name. 
> 
> 
> 

In your case, `newsModel` violates the rule, and the CodeIgniter name parser is probably not finding the class (or the relevant .php file), which is why it thinks `newsModel` is a property (that does not exist).
This is very comman problem with CI2.

this function must be inside one of ur models right ?

if so, please note that `u can't reference model from inside other model` ! for some reason. u need to let controller handle that