CodeIgniter Forums
Codeigniter And Mysql Procedure Problem ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Codeigniter And Mysql Procedure Problem ? (/showthread.php?tid=47271)



Codeigniter And Mysql Procedure Problem ? - El Forum - 12-01-2011

[eluser]Unknown[/eluser]
How Do I Use ?

My Procedure Library

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


/**
*
* @package  CodeIgniter
* @subpackage Libraries
* @category Database
* @author  Hakan KAYA
* @info  Codeigniterda Mysqli Procedureleri Sorunsuz Olarak Kullanmak İçin Yazılmıştır.
*/


class Procedure
{
   var   $CI;
   public  $result  = NULL; // Dönen Değer Değişkeni
  
  
   public function __construct()
   {
     $this->CI = & get_instance();
  
   }
  
  
   /**
  * Mysqli Procedureleri Kullanmak İçin Yazılmış Query Fonksiyonu
  *
  * @access public
  * @param string Sql Cümlesi
  * @return string Dönen Değerler
*/
  
   public function query($sql)
   {
  
    
  // Sql Sorgusunu Çalıştır Sonucu resulta At
     $this->result =   $this->CI->db->query($sql);

              // Procedure İçin Yazılmış
     while(mysqli_next_result($this->CI->db->conn_id)){
            if($l_result = mysqli_store_result($this->CI->db->conn_id)){
              mysqli_free_result($l_result);
             }
     }
  // Procedure İçin Yazılmış  
  
   // Sonucu Döndür
   return $this->result;
    
   }
  
}

1 - 2 Query And Result No Problem
4 - 5 Query And Result "Commands out of sync; you can't run this command now "

Do not have an exact result? for Use