Welcome Guest, Not a member yet? Register   Sign In
how to fix this error?
#4

[eluser]chmod[/eluser]
[quote author="TheFuzzy0ne" date="1246894103"]You're model should probably be returning either an array or an object. You can't use the result object directly:
Code:
$res = $this->db->get('some_table');

$res = $res->result_array();

# OR

$res = $res->result();
[/quote]

I debug like following:

Code:
$username = $this->input->post('input_username');
         $password = $this->input->post('input_password');
         $sig_key = $this->input->post('sig_key');
        $tablename = $this->security_model->getMemberTableName($username);
        $session_data = array('tablename' => $tablename);
        $this->session->set_userdata($session_data);

         $this->form_validation->set_rules('input_username','lang:label_username','trim|xss_clean|required|callback_checkUserPass');
        $this->form_validation->set_rules('input_password','lang:label_password','trim|xss_clean|required');
        var_dump($this->form_validation->run()); //---->output boolean(true)
        exit;
        $this->form_validation->set_rules('sig_key', 'lang:sig_key', 'trim|xss_clean|required|callback_checkSigKey');
        echo $this->session->userdata('sig_key');
        var_dump($this->form_validation->run()); //----->output error information
exit;

/*
A PHP Error was encountered

Severity: 4096

Message: Object of class CI_DB_mysql_result could not be converted to string

Filename: libraries/Form_validation.php

Line Number: 1205
A PHP Error was encountered

Severity: Notice

Message: Object of class CI_DB_mysql_result to string conversion

Filename: libraries/Form_validation.php

Line Number: 1205


*/

my callback checkSigKey function like these:
Code:
function checkSigKey(){
         if ($this->session->userdata('sig_key') !== $this->input->post('sig_key')){
             $this->form_validation->set_message('checkSigKey', $this->lang->line('sig_key_invalid'));
             return false;
         }else{
             return true;
         }
     }

what's the problem?


Messages In This Thread
how to fix this error? - by El Forum - 07-06-2009, 04:08 AM
how to fix this error? - by El Forum - 07-06-2009, 04:28 AM
how to fix this error? - by El Forum - 07-06-2009, 06:32 AM
how to fix this error? - by El Forum - 07-06-2009, 07:12 AM
how to fix this error? - by El Forum - 07-06-2009, 07:35 AM
how to fix this error? - by El Forum - 07-06-2009, 07:50 AM
how to fix this error? - by El Forum - 07-06-2009, 08:27 AM
how to fix this error? - by El Forum - 07-06-2009, 08:49 AM
how to fix this error? - by El Forum - 07-06-2009, 09:03 PM
how to fix this error? - by El Forum - 07-07-2009, 06:55 AM
how to fix this error? - by El Forum - 07-07-2009, 08:38 AM
how to fix this error? - by El Forum - 07-07-2009, 10:28 AM
how to fix this error? - by El Forum - 07-07-2009, 09:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB