title: Calling stored procedure in codeigniter
body: <p>I am using latest codeigniter and trying to call stored procedure from my model. Also I am using mysqli as database driver. Now I am having an error when I call two stored procedures. Following is the error:</p>
  
  <blockquote>
    <p>Error Number: 2014</p>
    
    <p>Commands out of sync; you can't run this command now</p>
    
    <p>call uspTest();</p>
    
    <p>Filename: E:\wamp\www\reonomy-dev\system\database\DB_driver.php</p>
    
    <p>Line Number: 330</p>
  </blockquote>
  
  <p>Note that when I call a single stored procedure it works fine. Here is the code for model.</p>
  
  <pre><code>class Menus_model extends CI_Model {
  
  function __construct()
  {
      parent::__construct();
  
  }
  
  public function getMenus()
  {
      $query = $this-&gt;db-&gt;query("call uspGetMenus()");
  
      return $query-&gt;result();
  }
  
  public function getSubMenus()
  {
      $query = $this-&gt;db-&gt;query("call uspTest()");
      return $query-&gt;result();
  }
  
  }
  </code></pre>
  
  <p>Here is the code from controller</p>
  
  <pre><code>class MYHQ extends CI_Controller {
  
  public function __construct()
  {
      parent::__construct();
      $this-&gt;load-&gt;model('menus_model');
  }
  
  public function index()
  {
      $menu = $this-&gt;menus_model-&gt;getMenus();
      $submenu = $this-&gt;menus_model-&gt;getSubMenus();
  }
  
  }
  </code></pre>
  
  <p>Is there any solution without hacking the core of codeigniter??</p>