Welcome Guest, Not a member yet? Register   Sign In
Simple query left join question - MVC
#4

[eluser]techgnome[/eluser]
I handled my similar situation in the model as part of my select statement:
Code:
$this->db->select("CASE WHEN ifnull(historylist.picture, '') = '' THEN 'na_01.jpg' ELSE historylist.picture END albumcover");
I did it like this, because it's part of the data logic as far as I am concerned. Neither the controller nor the view should care what the picture is... I did my best to keep the controllers fairly stupid and the views even dumber.

Not saying it's the best way or only way... just pointing out an alternative.

-tg


Messages In This Thread
Simple query left join question - MVC - by El Forum - 11-16-2010, 03:23 AM
Simple query left join question - MVC - by El Forum - 11-16-2010, 05:46 AM
Simple query left join question - MVC - by El Forum - 11-17-2010, 12:56 AM
Simple query left join question - MVC - by El Forum - 11-17-2010, 08:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB