mysqli_result 클래스
(PHP 5, PHP 7, PHP 8)
소개
데이터베이스에 대한 쿼리에서 얻은 결과 집합을 나타냅니다.
클래스 개요
class mysqli_result implements IteratorAggregate {
/* Properties */
public int $current_field;
public int $field_count;
public ?array $lengths;
public int|string $num_rows;
public int $type;
/* Methods */
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_array(int $mode = MYSQLI_BOTH): array|null|false
public fetch_assoc(): array|null|false
public fetch_column(int $column = 0): null|int|float|string|false
public fetch_field_direct(int $index): object|false
public fetch_field(): object|false
public fetch_fields(): array
public fetch_object(string $class = "stdClass", array $constructor_args = []): object|null|false
public fetch_row(): array|null|false
public field_seek(int $index): bool
public free(): void
public close(): void
public free_result(): void
public getIterator(): Iterator
}
Properties
type
- 결과가 버퍼링되었는지 또는 버퍼링되지 않았는지 int(각각
MYSQLI_STORE_RESULT
또는MYSQLI_USE_RESULT
)로 저장합니다.
변경 로그
버전 | 설명 |
---|---|
8.0.0 | mysqli_result는 이제 IteratorAggregate를 구현합니다. 이전에는 Traversable이 대신 구현되었습니다. |
목차
- mysqli_result::__construct — mysqli_result 객체를 생성합니다.
- mysqli_result::$current_field — 결과 포인터의 현재 필드 오프셋 가져오기
- mysqli_result::data_seek — 결과의 임의의 행에 대한 결과 포인터를 조정합니다.
- mysqli_result::fetch_all — 모든 결과 행을 연관 배열, 숫자 배열 또는 둘 다로 가져옵니다.
- mysqli_result::fetch_array — 결과 집합의 다음 행을 연관, 숫자 배열 또는 둘 다로 가져옵니다.
- mysqli_result::fetch_assoc — 결과 집합의 다음 행을 연관 배열로 가져옵니다.
- mysqli_result::fetch_column — 결과 집합의 다음 행에서 단일 열을 가져옵니다.
- mysqli_result::fetch_field_direct — 단일 필드에 대한 메타데이터 가져오기
- mysqli_result::fetch_field — 결과 집합의 다음 필드를 반환합니다.
- mysqli_result::fetch_fields — 결과 집합의 필드를 나타내는 개체 배열을 반환합니다.
- mysqli_result::fetch_object — 결과 집합의 다음 행을 개체로 가져옵니다.
- mysqli_result::fetch_row — 결과 집합의 다음 행을 열거형 배열로 가져옵니다.
- mysqli_result::$field_count — 결과 집합의 필드 수를 가져옵니다.
- mysqli_result::field_seek — 결과 포인터를 지정된 필드 오프셋으로 설정
- mysqli_result::free — 결과와 관련된 메모리를 해제합니다.
- mysqli_result::getIterator — 외부 반복자 검색
- mysqli_result::$lengths — 결과 집합에서 현재 행의 열 길이를 반환합니다.
- mysqli_result::$num_rows — 결과 집합의 행 수를 가져옵니다.