EllisLab text mark
Advanced Search
     
Erro in Active record
Posted: 04 November 2012 09:17 PM   [ Ignore ]
Joined: 2012-11-04
2 posts

Hellow, Guys.

I’m having a problem with Active record class.

I alredy set tha autoload and database config, but it’s show a error mesage:

Fatal error: Call to a member function get() on a non-object

some one knows what is it? What is the source erro?

 
Posted: 05 November 2012 01:50 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2012-11-04
3 posts

Can you provide some more info, like post the code that is causing the error?

 
Posted: 05 November 2012 11:05 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-11-04
2 posts
Hack3y - 05 November 2012 01:50 AM

Can you provide some more info, like post the code that is causing the error?

in the model thare has

      function cadastrar($data)
{
    $this->attributes($data);
   
    $this->db->insert(‘participante’,$data; // $data is a associative array
}

In de controller has
function confirmar()

  $inscricao =  new InscricaoModel();
  $participante = new ParticipanteModel();
 
  $data = array(
  ‘nome’=>$this->input->post(‘nome’),
  ‘cpf’=>$this->input->post(‘cpf’),
  ‘email’=>$this->input->post(‘email’),
  ‘telefone’=>$this->input->post(‘telefone’),
  ‘instituicao’=>$this->input->post(‘instituicao’),
  ‘tipoInstituicao’=>$this->input->post(‘tipoInstituicao’)
  );

          $inscricao->cadastrar($data)
}

class file in the database autoload was initialized

$autoload[‘libraries’] = array(‘database’,‘session’,‘form_validation’);

and in the function __construct, the models classes was initialized, too.

function __construct()
{
  parent::__construct();
 
  $this->load->model(‘membroModel’);
  $this->load->model(‘inscricaoModel’);
  $this->load->model(‘participanteModel’); 
}