foreach($reader as $row)
$row represents a row of data
Since TDbDataReader is a forward-only stream, you can only traverse it once.
It is possible to use a specific mode of data fetching by setting
{@link setFetchMode FetchMode}. See {@link http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php}
for more details.
Mostrar archivo
Open project: pradosoft/prado
Method | Description | |
---|---|---|
__construct ( |
Constructor. | |
bindColumn ( $column, &$value, $dataType = null ) | Binds a column to a PHP variable. | |
close ( ) | Closes the reader. | |
current ( ) : mixed | Returns the current row. | |
getColumnCount ( ) : integer | ||
getIsClosed ( ) : boolean | ||
getRowCount ( ) : integer | ||
key ( ) : integer | Returns the index of the current row. | |
next ( ) | Moves the internal pointer to the next row. | |
nextResult ( ) | Advances the reader to the next result when reading the results of a batch of statements. | |
read ( ) : array | false | Advances the reader to the next row in a result set. | |
readAll ( ) : array | Reads the whole result set into an array. | |
readColumn ( $columnIndex ) : mixed | false | Returns a single column from the next row of a result set. | |
readObject ( $className, $fields ) : mixed | false | Returns a single column from the next row of a result set. | |
rewind ( ) | Resets the iterator to the initial state. | |
setFetchMode ( $mode ) | ||
valid ( ) : boolean | Returns whether there is a row of data at current position. |
public __construct ( |
||
$command |
public bindColumn ( $column, &$value, $dataType = null ) |
public getColumnCount ( ) : integer | ||
return | integer | the number of columns in the result set. Note, even there's no row in the reader, this still gives correct column number. |
public getIsClosed ( ) : boolean | ||
return | boolean | whether the reader is closed or not. |
public getRowCount ( ) : integer | ||
return | integer | number of rows contained in the result. Note, most DBMS may not give a meaningful count. In this case, use "SELECT COUNT(*) FROM tableName" to obtain the number of rows. |
public nextResult ( ) |
public readColumn ( $columnIndex ) : mixed | false | ||
return | mixed | false | the column of the current row, false if no more row available |
public readObject ( $className, $fields ) : mixed | false | ||
return | mixed | false | the populated object, false if no more row of data available |