![]() |
execute mysql stored procedure - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: execute mysql stored procedure (/showthread.php?tid=71664) |
execute mysql stored procedure - Anton_BNV - 09-11-2018 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(); } } RE: execute mysql stored procedure - php_rocs - 09-11-2018 @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. RE: execute mysql stored procedure - Pyerro - 09-11-2018 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)"); |