本文整理汇总了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();
}