to xuzuning(唠叨): mysqli 没有fetch_all这个函数.并不提供返回所有结果集的功能 . 只能一行一行的foreach.
mysqli result的方法只有这么多了.mysqli_result Represents the result set obtained from a query against the database. 方法close - closes resultsetdata_seek - moves internal result pointerfetch_field - gets column information from a resultsetfetch_fields - gets information for all columns from a resulsetfetch_field_direct - gets column information for specified columnfetch_array - fetches a result row as an associative array, a numeric array, or both.fetch_assoc - fetches a result row as an associative arrayfetch_object - fetches a result row as an objectfetch_row - gets a result row as an enumerated arrayclose - frees result memoryfield_seek - set result pointer to a specified field offset
// 函数: fetchAll()
// 功能: 从记录集中取出所有记录
// 返回: 记录集数组
//======================================
function fetchAll()
{
$arr = array();
while($this->record = mysql_fetch_array($this->queryID,$this->fetchMode))
{
$arr[] = $this->record;
}
mysql_free_result($this->queryID);
return $arr;
}
mysqli 没有fetch_all这个函数.并不提供返回所有结果集的功能 .
只能一行一行的foreach.
Represents the result set obtained from a query against the database. 方法close - closes resultsetdata_seek - moves internal result pointerfetch_field - gets column information from a resultsetfetch_fields - gets information for all columns from a resulsetfetch_field_direct - gets column information for specified columnfetch_array - fetches a result row as an associative array, a numeric array, or both.fetch_assoc - fetches a result row as an associative arrayfetch_object - fetches a result row as an objectfetch_row - gets a result row as an enumerated arrayclose - frees result memoryfield_seek - set result pointer to a specified field offset