The mysqli_result class

Introduction

Represents the result set obtained from a query against the database.

Class synopsis

mysqli_result
implements IteratorAggregate
/* Properties */
public readonly int $current_field;
public readonly int $field_count;
public readonly arraynull $lengths;
public readonly intstring $num_rows;
public int $type;
/* Methods */
public __construct(mysqli $mysql, int $result_mode = MYSQLI_STORE_RESULT)
public bool data_seek(int $offset)
public array fetch_all(int $mode = MYSQLI_NUM)
public arraynullfalse fetch_array(int $mode = MYSQLI_BOTH)
public arraynullfalse fetch_assoc()
public nullintfloatstringfalse fetch_column(int $column = 0)
public objectfalse fetch_field()
public objectfalse fetch_field_direct(int $index)
public array fetch_fields()
public objectnullfalse fetch_object(string $class = "stdClass", array $constructor_args = [])
public arraynullfalse fetch_row()
public true field_seek(int $index)
public void free()
public void close()
public void free_result()
public Iterator getIterator()

Properties

type

Stores whether the result is buffered or unbuffered as an int (MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT, respectively).

Changelog

Version Description
8.0.0 mysqli_result implements IteratorAggregate now. Previously, Traversable was implemented instead.
Table of Contents