本文整理匯總了PHP中mysqli::fetch_all方法的典型用法代碼示例。如果您正苦於以下問題:PHP mysqli::fetch_all方法的具體用法?PHP mysqli::fetch_all怎麽用?PHP mysqli::fetch_all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mysqli
的用法示例。
在下文中一共展示了mysqli::fetch_all方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: nativeQuery
/**
* Actually execute a query.
* Logs statement and result if a logger is set.
*
* @return mysqli_result
*/
public function nativeQuery($statement)
{
// Logging disabled
if (!isset($this->log)) {
return $this->native->query($statement);
}
// Logging enabled
$sec = microtime(true);
$result = $this->native->query($statement);
$time = microtime(true) - $sec;
unset($sec);
$count = is_object($result) ? $result->num_rows : $this->native->affected_rows;
$errno = $this->native->errno;
$error = $this->native->error;
$rows = array();
if (isset($this->logSettings['rows'])) {
if (function_exists('mysqli_fetch_all')) {
$rows = $this->native->fetch_all(MYSQLI_NUM);
} else {
while ($row = $this->native->fetch_row()) {
$rows[] = $row;
}
}
break;
}
$args = call_user_func_array('compact', $this->logColumns);
$this->log->write($args, 'db-query');
return $result;
}