2011-12-01 2 views
1

어떻게 사용합니까?Codeigniter 및 PHP의 Mysql 프로 시저

내 절차 도서관

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

    class Procedure 
    { 
     var $CI; 
     public $result = NULL; // Dönen Değer Değişkeni 

     public function __construct() 
     { 
      $this->CI = & get_instance(); 

     } 

     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 쿼리 및 결과 : 문제 없음

4-5 쿼리 및 결과 :

Commands out of sync; you can’t run this command now 

는 정확한 결과가 없습니까? for

+3

귀하의 질문을 이해하는 것이 어렵습니다. 적절한 영어 문장을 사용해보십시오. – talnicolas

+0

mmmh 나중에 ... 잘 ... – talnicolas

답변

0

CI 결과 개체를 반환하지 않는 이유는 무엇입니까?

$this->result = $this->CI->db->query($sql, TRUE)->result(); 

... while 루프를 사용하는 대신? CI는 아마 이미 루프를 실행하고, 모든 결과는