[eluser]Unknown[/eluser]
Hi Guyz!
I have a little problem with global variables.
I have some page on my site, which presents portfolio. It shows 6 small thumbs and when you click on particular thumb, it shows full page along with some additional info regarding that site. It's pretty straightforward. So, in my model, I've used this:
Code:
function get_entries_by_limit($limit_from, $limit_num)
{
$query = $this->db->get('sites', $limit_num, $limit_from);
return $query->result();
}
Limit number is 6, always, but, $limit_from is a variable which needs to be global. At portfolio index, I have a call
get_entries_by_limit(0, 6) and it's fine, but now I need two things: 1) where to define global variable $limit_frpm; 2) when I click previous/next buttons to decrement/increment $limit_from. After the increment/decrement, I want to call
get_entries_by_limit($limit_from, 6);.
Sorry if similar question was already posted by someone. I've used the search engine, but couldn't find it.