mysqli_result 类

(PHP 5, PHP 7, PHP 8)

简介

代表从一个数据库查询中获取的结果集。

类摘要

class mysqli_result implements IteratorAggregate {
/* 属性 */
public readonly int $current_field;
public readonly int $field_count;
public readonly ?array $lengths;
public readonly int|string $num_rows;
public int $type;
/* 方法 */
public __construct(mysqli $mysql, int $result_mode = MYSQLI_STORE_RESULT)
public data_seek(int $offset): bool
public fetch_all(int $mode = MYSQLI_NUM): array
public fetch_column(int $column = 0): null|int|float|string|false
public fetch_object(string $class = "stdClass", array $constructor_args = []): object|null|false
public field_seek(int $index): true
public free(): void
public close(): void
public free_result(): void
}

属性

type

存储的是否为缓冲的结果,int 形式(分别是 MYSQLI_STORE_RESULTMYSQLI_USE_RESULT)。

更新日志

版本 说明
8.0.0 mysqli_result 现在实现 IteratorAggregate。之前实现的是 Traversable

目录

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top