Documentation Home
MySQL PHP API
Download this Manual
PDF (US Ltr) - 2.4Mb
PDF (A4) - 2.4Mb


MySQL PHP API  /  MySQL Improved Extension  /  The mysqli_result class

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 int current_field ;
  public int field_count ;
  public array|null lengths ;
  public 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();
}

type

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

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