PDOStatement::fetch
Fetches the next row from a result set
Description
arrayPDOStatement::fetch
intfetch_style
&warn.experimental.func;
Fetches a row from a result set associated with a PDOStatement object.
fetch_style can be one of the following values:
PDO_FETCH_NUM: returns an array indexed by column
number as returned in your result set, starting at column 0
PDO_FETCH_ASSOC: returns an array indexed by column
name as returned in your result set
PDO_FETCH_BOTH (default): returns an array indexed by
both column name and column number as returned in your result set
PDO_FETCH_OBJ: returns an anonymous object with
property names that correspond to the column names returned in your
result set
PDO_FETCH_LAZY: combines
PDO_FETCH_BOTH and PDO_FETCH_OBJ,
creating the object variable names as they are accessed
PDO_FETCH_BOUND: returns &true; and assigns the
values of the columns in your result set to the PHP variables to which
they were bound with the PDO::bindParam method