0
I’m not getting out of place because of this mistake.
My model looks like this
public function conf($dados){
$this->db->select('id');
$this->db->where('senha',$dados);
$query = $this->db->get('email');
return $query->row();
}
and my controller is as follows:
public function fim(){
$this->load->model('quest_model');
$this->load->helper('quest');
$data = $this->input->post('senha');
$dados['quest'] = $this->email_model->emailconf($data);
$dados['quest1'] = $this->quest_model->get_quest();
$dados['quest2'] = $this->quest_model->get_quest2();
$dados['ques1'] = $this->quest_model->get_ques();
$dados['ques2'] = $this->quest_model->get_ques2();
$this->load->view('quest/file',$dados);
}
I already changed the $data for $data['p'] for example and did not stop giving this error the same way.
the error you are making is as follows: PHP Error was encountered
Severity: 4096
Message: Object of class stdClass could not be converted to string
Filename: quest/file.php
Line Number: 49
I used the print_r and is printing everything right, I’m not able to find the error, if you can help me thank you very much
thank you all
Not knowing what’s in that method
emaiconf()
, what you can suggest is debugging by creating a breakpoint. On the line before$dados['quest']
, put it like this:var_dump($data);
and on the next line putvar_dump($this->email_model->emailconf($data)); exit;
. Put the question there, what comes back. Just be careful with sensitive data, if you have a password and things like that, replace it with dummy data before you go public.– Daniel Omine
Enter all the code including the View. The file.php also.
– novic
hello daniel, I did what you said, what you returned was:
string(9) "senhaX" object(stdClass)#20 (1) { ["idques"]=> string(1) "5" }
– Gabriel Silva