Welcome Guest, Not a member yet? Register   Sign In
Two questions ( max query and displaying images )
#2

[eluser]Aken[/eluser]
If your comics are in order by their ComicId, you can just select the highest one by ordering them by ComicId in descending order, and limit the query to one result.

Code:
// UNTESTED, should be close to what you need at least.
public function get_comic()
{
return $this->db
  ->order_by('ComicId', 'desc')
  ->limit(1)
  ->get('comic')
  ->row_array();
}

// If you call this function like this:
$comic = $this->your_model->get_comic();

// Then you access your column names like:
// $comic['column_name']
$image_url = $comic['ComicUrl'];


Messages In This Thread
Two questions ( max query and displaying images ) - by El Forum - 02-24-2012, 02:21 PM
Two questions ( max query and displaying images ) - by El Forum - 02-27-2012, 12:36 AM
Two questions ( max query and displaying images ) - by El Forum - 02-27-2012, 09:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB