Welcome Guest, Not a member yet? Register   Sign In
execute mysql stored procedure
#1

hallo..

i've a stored procedure. when i run it in my admin page, it gave me a results. But when i executed it from my Model, it gave me an empty result.

Here is my code to execute it :

public function get_data($id, $id_sub){

$sql_query=$this->db->query("call sp_get_deep('".$id."','".$id_sub."')");     //--> Give me an empty result.
    mysqli_next_result( $this->db->conn_id);
            if($sql_query->num_rows()==1){
                return $sql_query->row_array();
            }
}

Attached Files Thumbnail(s)
   
Reply
#2

@Anton_BNV,

What is the output from the stored procedure suppose to be? Maybe you should to a var_dump of $sql_query to see what is in it.
Reply
#3

Maybe get rid of the single and double quotes around $id and $id_sub:

$sql_query=$this->db->query("call sp_get_deep($id, $id_sub)");
Reply




Theme © iAndrew 2016 - Forum software by © MyBB