/**
  * Binds this statement to the variables
  */
 protected function bind()
 {
     $variables = array();
     // Bind each field
     while ($field = $this->metadata->fetch_field()) {
         $this->columns[] = $field->name;
         // Note that while boundValues isn't initialised at this point,
         // later calls to $this->statement->fetch() Will populate
         // $this->boundValues later with the next result.
         $variables[] =& $this->boundValues[$field->name];
     }
     call_user_func_array(array($this->statement, 'bind_result'), $variables);
     $this->bound = true;
     $this->metadata->free();
     // Buffer all results
     $this->statement->store_result();
 }
Пример #2
0
Файл: Result.php Проект: jasny/Q
 /**
  * Fetch a result row as an associative array, group per table
  * 
  * @param int $opt  Additional options as binary list
  * @return array
  */
 public function fetchPerTable($opt = 0)
 {
     $values = array();
     $row = $this->native->fetch_row();
     if (!isset($row)) {
         return null;
     }
     $this->native->field_seek(0);
     while ($field = $this->native->fetch_field()) {
         list(, $values[$field->table][$field->name]) = each($row);
     }
     return $values;
 }
Пример #3
0
 public function getResult($row = 0, $field = 0)
 {
     $this->result->data_seek($row);
     $this->result->field_seek($field);
     return $this->result->fetch_field();
 }