[eluser]alvaroeesti[/eluser]
Hi,
over a week stuck with the issue and not even showing it on a video did I get any clue.
Scenario:
I have a form in the frontpage to select data which retrieves rows of data in the next page inside. Results are displayed ok, but they need to be paginated. No way to get that. All examples of pagination are based on too easy scenarios, where they just directly fetch all of the rows from a table but there are no posted variables with data received from a form elsewhere on the web to be used to retrieve specifically filtered data (with WHERE clauses)
The posted values from the form are received by a controller, which validates them and does display the rows of data corresponding to those values in that table.
However, when I click on the pagelink, nothing is retrieved.
I tried then to do this:
Just put in a session array the posted values originally selected in the form. like country, state, region and item. However, those session values are also lost! wtf! they are session values, they are supposed to be globally available!
This is what I did:
Code:
public function validateData($offset = '')
{$this->form_validation->set_rules('object', 'object', 'trim|max_length[30]|xss_clean');
$this->form_validation->set_rules('paises', 'paises', 'trim|max_length[30]|xss_clean');
.....
$object = $this->input->post('object');
$paises = $this->input->post('paises');
...
//Here is where I create the session array to store the posted values from the Form:
$newdata = array(
'object' => $object,
'paises' => $paises,
....
//And this effectively saves those values in a cookie session:
$this->session->set_userdata($newdata);
Well, I have that in the controller that receives the data from the form, AND I also put it in the view page that that controller loads in order to show the displayed data. Those session values are still kept this far, BUT, when I click on the pagelink to wishfully expect another chunk of data (from the Limit and Offset stuff), all goes blank, the array goes to 0 and all session data are gone.