For this, we will use the query method I mentioned before.

<?php
foreach($db->query('SELECT * FROM users') as $row) {
    echo $row['name'] . '<br/>';
}
?>