Welcome Guest, Not a member yet? Register   Sign In
using database library calls within a helper
#5

[eluser]Boris Strahija[/eluser]
[quote author="AF" date="1251699598"]I am just starting to use CI, and I am getting stuck with this same issue. It may be that I am thinking incorrectly in how to arrange my code.

I have a set of helper functions that deal with adding some functionality to the calendar library. Within those functions, I need to get a difference between two date. This is very easy in mysql, select date_diff. But I have been completely unable to make database calls unless the function is in a model. And if the function is in a model, I cannot use the function in a helper. I can't use $this within a helper function...

I have to be thinking of this incorrectly, any assistance?[/quote]
I think you're doing it the wrong way. Why don't you just make a pure PHP function, without the db call.


Messages In This Thread
using database library calls within a helper - by El Forum - 08-30-2009, 07:19 PM
using database library calls within a helper - by El Forum - 08-30-2009, 09:34 PM
using database library calls within a helper - by El Forum - 08-30-2009, 10:17 PM
using database library calls within a helper - by El Forum - 08-30-2009, 10:45 PM
using database library calls within a helper - by El Forum - 08-31-2009, 02:18 AM
using database library calls within a helper - by El Forum - 08-31-2009, 07:23 AM
using database library calls within a helper - by El Forum - 08-31-2009, 09:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB