You can access all the data in the Rowset as an array using the
toArray() method of the Rowset object. This returns an array
containing one entry per Row. Each entry is an associative array having keys that
correspond to column names and elements that correspond to the respective column values.
Example 318. Using toArray()
<?php
$bugs = new Bugs();
$rowset = $bugs->fetchAll();
$rowsetArray = $rowset->toArray();
$rowCount = 1;
foreach ($rowsetArray as $rowArray) {
echo "row #$rowCount:\n";
foreach ($rowArray as $column => $value) {
echo "\t$column => $value\n";
}
++$rowCount;
echo "\n";
}
The array returned from toArray() is not updateable. That is,
you can modify values in the array as you can with any array, but changes to the array
data are not propagated to the database.




