Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 5.3Mb
PDF (A4) - 5.3Mb

Connectors and APIs Manual  /  ...  /  The mysqli_result class

7.3.10 The mysqli_result class

Copyright 1997-2022 the PHP Documentation Group.

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

 mysqli_result {
mysqli_result , IteratorAggregate Properties  public readonly int current_field ;
  public readonly int field_count ;
  public readonly array|null lengths ;
  public readonly int|string num_rows ;
  public int type ;
Methods  public mysqli_result::__construct(mysqli mysql,
                                    int result_mode= =MYSQLI_STORE_RESULT);

  public bool mysqli_result::data_seek(int offset);
  public array mysqli_result::fetch_all(int mode= =MYSQLI_NUM);
  public array|null|false mysqli_result::fetch_array(int mode= =MYSQLI_BOTH);
  public array|null|false mysqli_result::fetch_assoc();
  public null|int|float|string|false mysqli_result::fetch_column(int column= =0);
  public object|false mysqli_result::fetch_field_direct(int index);
  public object|false mysqli_result::fetch_field();
  public array mysqli_result::fetch_fields();
  public object|null|false mysqli_result::fetch_object(string class= ="stdClass",
                                                       array constructor_args= =[]);

  public array|null|false mysqli_result::fetch_row();
  public bool mysqli_result::field_seek(int index);
  public void mysqli_result::free();
  public void mysqli_result::close();
  public void mysqli_result::free_result();
  public Iterator mysqli_result::getIterator();


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

8.0.0mysqli_result implements IteratorAggregate now. Previously, Traversable was implemented instead.