0

I have a MySQL procedure GET_JOB_ID, output parameter is job_id. Then I call it from codeigniter

$data = $this->db->query("CALL GET_JOB_ID()");

Then how can I get the output parameter job_id from codeigniter?

1 Answer 1

1

I got the answer.

$job_id = 0;
    $this->load->database();   
    $job_data = $this->db->query("CALL GET_JOB_ID(@job_id)");
    $out_param_query = $this->db->query('select @job_id as job_id;'); 
    foreach ($out_param_query->result() as $key) {
        $job_id = $key->job_id;
    }
    $this->db->close();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.