Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord and Sessions issues?
#1

[eluser]bhogg[/eluser]
Hi all,

Got a couple annoying problems and hoping someone might know the answers!

1) Using an ActiveRecord in certain situations will either return all the records, or return nothing at all. I can literally hit Refresh a few times and watch as sometimes the query returns the correct results and others it does not.

$query = $this->db->get($tablename);
$ret = $query->result_array();
return $ret;

There are no errors displayed with debug on when the results are not displayed. Any ideas?

2) I'm using session variables to save the page to re-direct to after another form is submitted. I'm using basic code such as:

$this->session->set_userdata('redirect', 'opportunities/edit/1');

Right after this is set, I can echo $this->session->userdata('redirect') and get the expected result. When I attempt to retrieve the value on the next page, (ie. echo $this->session->userdata('redirect')) it returns 'opportunities/edit/' (the 1 is dropped). Even if I put a / on the end - ie. opportunities/edit/1/, it returns opportunities/edit//.

Why is the digit one being dropped?


Thanks for any and all help you can provide.

Regards,
Brian


Messages In This Thread
ActiveRecord and Sessions issues? - by El Forum - 02-27-2008, 03:02 PM
ActiveRecord and Sessions issues? - by El Forum - 02-29-2008, 01:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB