Welcome Guest, Not a member yet? Register   Sign In
Undefined property: CI_Input::$post
#1

[eluser]joe_h[/eluser]
Hi I try to insert data through a controller that calls a function of the model and gives me the following error:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Input::$post
Filename: ......php
Line Number: ....


Code that is in the function of this model is:

Code:
$this->provincia = $this->input->post['provincia'];
        if($this->provincia){
            $data = array(
                'provincia' => $this->provincia
            );
            $query = $this->db->insert('provincias', $data);

Any idea???

#2

[eluser]Bhashkar Yadav[/eluser]
correct you first line of code as
Code:
$this->provincia = $this->input->post('provincia');
#3

[eluser]joe_h[/eluser]
Here is the answer

http://ellislab.com/forums/viewthread/73...10/#390918

$this->input->post is not an array, it’s a function/method, ie: $this->input->post(‘loginformsent’);
#4

[eluser]joe_h[/eluser]
Thank you Bhashkar




Theme © iAndrew 2016 - Forum software by © MyBB