[eluser]RobbieL[/eluser]
Thanks for the feedback guys. Much appreciated.
I've gone ahead and started to use models, but seems I've fallen at the first hurdle. I can't see anything obvious wrong with the code, but it something must be wrong as all I get is a blank white page.
View:
Code:
<?php if($getSongList->num_rows() > 0):?>
<?php foreach($getSongList->result() as $song):?>
<?$artist = $song->artist?>
<?$album = $song->album?>
<?$songID = $song->id?>
<?=$song->playtime?>
<?=$song->artist?>
<?=$song->album?>
<?=$song->genre?>
<?php endforeach;?>
<?php endif;?>
Controller:
Code:
function loadSongList()
{
$data['getSongList'] = $this->music_model->get_SongList();
$this->load->view('includes/musicList_include.php', $data);
}
Model:
Code:
function get_SongList()
{
$query = $this->db->query("SELECT id, title, playtime, artist, album, genre, fileOrigName FROM songs WHERE ownerID='". $_SESSION['username']."' ORDER BY artist ASC");
return $query->result();
}
The same query was working just fine previously when I had all my queries in the controller. Anyone any ideas?