PHP. Руководство по PHP. 2005
PDOStatement::fetch
PDOStatement::fetch
(no version information, might be only in CVS)PDOStatement::fetch -- Fetches the next row from a result set
Описание
mixed PDOStatement::fetch ([int fetch_style [, int cursor_orientation [, int cursor_offset]]])Внимание |
-Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ.
Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск. |
Fetches a row from a result set associated with a PDOStatement object.
Список параметров
fetch_style
Controls how the next row will be returned to the caller. This value must be one of the PDO_FETCH_* constants, defaulting to PDO_FETCH_BOTH.
PDO_FETCH_ASSOC: returns an array indexed by column name as returned in your result set
cursor_orientation
For a PDOStatement object representing a scrollable cursor, this value determines which row will be returned to the caller. This value must be one of the PDO_FETCH_ORI_* constants, defaulting to PDO_FETCH_ORI_NEXT.
offset
For a PDOStatement object representing a scrollable cursor for which the cursor_orientation parameter is set to PDO_FETCH_ORI_ABS, this value specifies the absolute number of the row in the result set that shall be fetched.
For a PDOStatement object representing a scrollable cursor for which the cursor_orientation parameter is set to PDO_FETCH_ORI_REL, this value specifies the row to fetch relative to the cursor position before PDOStatement::fetch() was called.
Примеры
Пример 2. Fetching rows with a scrollable cursor
Результат выполнения данного примера:
|
Смотрите также
PDO::query() |
PDOStatement::fetchAll() |
PDOStatement::fetchColumn() |
PDOStatement::prepare() |
PDOStatement::setFetchMode() |
PDOStatement::execute
PDOStatement::fetchAll