<?php include 'DBController.php'; class AlbumController { function __construct() { } function get_albums() { $db = new DBController(); return $db->get_album(); } } $album = new AlbumController(); while ($row = $album->get_albums()->fetchArray()) { var_dump($row); echo $row['date']; }