Db\Result\Pdo::fetch

public fetch ([mixed $fetchStyle], [mixed $cursorOrientation], [mixed $cursorOffset])

Fetches an array/object of strings that corresponds to the fetched row, or FALSE if there are no more rows. This method is affected by the active fetch flag set using Phalcon\Db\Result\Pdo::setFetchMode

1
2
3
4
5
$result = $connection->query("SELECT * FROM robots ORDER BY name");
$result->setFetchMode(Phalcon\Db::FETCH_OBJ);
while ($robot = $result->fetch()) {
    echo $robot->name;
}
doc_Phalcon
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.