2.0.0 Beta 3
Pre-release
Pre-release
- Added
Result::fetchRow()
, which will return a single row (associative array) from the result set on each call until no further rows remain in the result.
// Iterate over result rows with a simple while loop
while ($row = $result->fetchRow()) {
// ...
}
// Also useful if you know your result will contain only a single row
$id = $result->fetchRow()['id'] ?? throw new Exception('Item not found');