本文整理匯總了PHP中mysqli_result::fetch_field方法的典型用法代碼示例。如果您正苦於以下問題:PHP mysqli_result::fetch_field方法的具體用法?PHP mysqli_result::fetch_field怎麽用?PHP mysqli_result::fetch_field使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mysqli_result
的用法示例。
在下文中一共展示了mysqli_result::fetch_field方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bind
/**
* 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: fetchPerTable
/**
* 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: getResult
public function getResult($row = 0, $field = 0)
{
$this->result->data_seek($row);
$this->result->field_seek($field);
return $this->result->fetch_field();
}