Welcome Guest, Not a member yet? Register   Sign In
Passing a function
#4

[eluser]bretticus[/eluser]
[quote author="Kola" date="1287093525"]Yeah what I'm storing is merely the product nr. and a small text like 'Wierd fancy ear ring!' for small captions.[/quote]

This is how I do it also.

So yes, create a helper that can access your database.

Code:
//for example.
function get_images($id) {
$CI =& get_instance();
return $CI->db->where('image_id', $id)->get('images')->row();
}

Or better yet, grab the information from a Model and just pass it in the second param of your load view call.


Messages In This Thread
Passing a function - by El Forum - 10-14-2010, 10:50 AM
Passing a function - by El Forum - 10-14-2010, 10:56 AM
Passing a function - by El Forum - 10-14-2010, 10:58 AM
Passing a function - by El Forum - 10-14-2010, 11:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB