Welcome Guest, Not a member yet? Register   Sign In
question to sessions
#1

[eluser]RcCluster[/eluser]
hi,

i do a query and try to store the result in a session-var

Code:
if ($Query->num_rows() > 0) {
  $rows = $Query->result_array();
  $this->session->set_userdata('ausgabeArray', $rows);

but i get no output then.

if i change the code to

Code:
if ($Query->num_rows() > 0) {
  $rows = $Query->result_array();
  echo "mist";
  $this->session->set_userdata('ausgabeArray', $rows);

then there is the right output except the errors at the top of the page (Message: Cannot modify header information ...)

is there someone out there knowing things like this?

thanks
RcCluster
#2

[eluser]sl3dg3hamm3r[/eluser]
What output do you expect from that snippet? You just set a session-var, but you don't echo anything. You might read your session-var like that:

Code:
echo $this->session->userdata('ausgabeArray');

P.s.: Please note that if you don't use any session-table on the database, the possible length of session-data is restricted.
#3

[eluser]RcCluster[/eluser]
[quote author="sl3dg3hamm3r" date="1243427845"]What output do you expect from that snippet? You just set a session-var, but you don't echo anything. You might read your session-var like that:

Code:
echo $this->session->userdata('ausgabeArray');

P.s.: Please note that if you don't use any session-table on the database, the possible length of session-data is restricted.[/quote]

i use this var to convert the ausgabeArray to excel via a php class. some queries need more than a few seconds thus i try it in this way.

i will change to session-table.

thanks
RcCluster
#4

[eluser]RcCluster[/eluser]
[quote author="sl3dg3hamm3r" date="1243427845"]P.s.: Please note that if you don't use any session-table on the database, the possible length of session-data is restricted.[/quote]

thanks thats it!




Theme © iAndrew 2016 - Forum software by © MyBB