stdClass Object ( [data] => can't seem to access the valu
Posted: Thu Jul 06, 2006 10:49 pm
Am using PEAR:: DB for establishing and accessing a database.
For getting a result set I use something like this:
$data = $dataRow->fetchRow();
However, this is not the reason for posting. This works fine and the output with print_r($data) echoes something like this:
stdClass Object ( [data] => __HTTP_Session_Info|i:1;__HTTP_Session_Expire_TS|i:1152239116;__HTTP_Session_Idle|i:5;UserName|s:11:"blah";Password
|s:32:"0515105115j1g515gfs1";ShortName|s:3:"sigstus";submit|s:6:"submit";counter|i:0;__HTTP_Session_Idle_TS|i:1152239056; )
Now, I'd like to access the values, e.g. UserName or ShortName
$data->ShortName;
doesn't work...
Even
$now =unserialize($data);
$now->ShortName;
is the wrong approach.
How can I access these values?
Cheers Jan
For getting a result set I use something like this:
$data = $dataRow->fetchRow();
However, this is not the reason for posting. This works fine and the output with print_r($data) echoes something like this:
stdClass Object ( [data] => __HTTP_Session_Info|i:1;__HTTP_Session_Expire_TS|i:1152239116;__HTTP_Session_Idle|i:5;UserName|s:11:"blah";Password
|s:32:"0515105115j1g515gfs1";ShortName|s:3:"sigstus";submit|s:6:"submit";counter|i:0;__HTTP_Session_Idle_TS|i:1152239056; )
Now, I'd like to access the values, e.g. UserName or ShortName
$data->ShortName;
doesn't work...
Even
$now =unserialize($data);
$now->ShortName;
is the wrong approach.
How can I access these values?
Cheers Jan