Code Igniter truly rocks
Posted 537 days ago | (0) Comments
Its been a couple years since I moved away from Classic ASP development and it’s code snippets like this that truly showcase the beauty of using a well designed framework to code with. Check out this wicked query in Code Igniter:
function get_popular_songs() { $this->db->select(‘listens.total_listens’); $this->db->select(‘albums.slug AS album_slug’); $this->db->select(‘artists.slug’); $this->db->select(‘songs.*’); $this->db->from(‘listens’);
$this->db->join(‘songs’, ‘songs.id = listens.song_id’, ‘left’); $this->db->join(‘albums’, ‘songs.album_id = albums.id’, ‘left’); $this->db->join(‘artists’, ‘songs.artist_id = artists.id’, ‘left’); $this->db->orderby(‘listens.total_listens’, ‘desc’); $this->db->limit(10);
$return = $this->db->get(); }
I’d hate to imagine how confusing writing this SQL statement by hand would be in Classic ASP. Ouch!
Comments Anyone?
Be the First to Comment!
What an exciting opportunity for you! FIRST...It just sounds cool!

