Пример #1
0
 /**
  * Force buffering
  *
  * @throws Exception\RuntimeException
  */
 public function buffer()
 {
     if ($this->resource instanceof \mysqli_stmt && $this->isBuffered !== true) {
         if ($this->position > 0) {
             throw new Exception\RuntimeException('Cannot buffer a result set that has started iteration.');
         }
         $this->resource->store_result();
         $this->isBuffered = true;
     }
 }
Пример #2
0
 /**
  * Get all array data
  *
  * @return array
  */
 public function getFetchArrays()
 {
     $data = array();
     if ($this->resource instanceof \mysqli_result) {
         $result = $this->resource;
     } else {
         if ($this->resource instanceof \mysqli_stmt) {
             $result = $this->resource->get_result();
         } else {
             if ($this->resource instanceof \mysqli) {
                 $result = $this->resource->store_result();
             }
         }
     }
     while ($row = $result->fetch_array(\MYSQLI_ASSOC)) {
         $data[] = $row;
     }
     return $data;
 }