Welcome Guest, Not a member yet? Register   Sign In
Problems retreiving session data on View page
#4

(This post was last modified: 01-26-2015, 05:55 PM by user2374.)

I changed all of the array data back to an associative array in the controller and updated my code in the view to call the data in the associative array. It still does not work.

The code below from my view, calling the session userdata array element and putting it in a specific table cell, is exactly like how it is set up with the original functionality:

PHP Code:
<?= $this->session->userdata['1']; ?>

When I do the above now, even though it worked fine like this before, it just gives me the undefined index error.

The docs say to do this:

PHP Code:
<?= $this->session->userdata('1'); ?>

Doing this, the undefined error is gone for those table cells but no data is showing up. But even if I do this, I will have no way to loop through my session userdata array. I'm sire there is a way but I have no idea how to do it without an index. I need to put information into the array in a certain order so that it is displayed in the table in the same order. The number of rows is dynamic and I want different results in the table for each search, so each array element must be generated from a separate call to it's function.

Man this is so messed up. It WAS working both as an associative and as a numeric array. I make VERY small changes and check to see if the results are as expected. I just don't understand how it can not be working when I undid all of the edits made after the last known working configuration. Ah this is so frustrating!
Reply


Messages In This Thread
RE: Problems retreiving session data on View page - by user2374 - 01-26-2015, 05:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB