Odd Lazy_Load() situation

edited March 2013 in Bug Reports
I'm pretty sure I'm doing something incorrectly, but it doesn't seem so.

I'm using lazy_load() in my Base_module_record() class for a couple quick methods to get data from related model's.

The methods are basically the same, they're just pulling similar data from the 2 model's, but the situation occurs if I use both in the same loop in the view. If I use one or the other, it works perfectly.

On the 2nd one called, I get the following debug_query():
SELECT * FROM (`ci_sessions`) WHERE `session_id` = '9f7b507e628b8a914463bf957bb6b76f' AND `user_agent` = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0' Second testimonial

I can be going through the loop more than once and get the same results, the first method works, the second gives the error... and repeat.

Any idea why?

Comments

  • edited 6:16AM
    The 5th parameter of lazy_load is the cache_key. What happens if you set that to a different value for each call? Do you have an example of how it is being called?
  • edited 6:16AM
    Looks like that was the ticket! Just had to make sure they were both being cached separately :)

    Amazing :)
Sign In or Register to comment.