读取session中数组问题
本帖最后由 zl2727 于 2013-12-26 16:50:24 编辑
$query ="select * from #@__arctype where isbaike=1";
$this->dsql->Execute("bkarry",$query);
$bkarry=array();
session_start();
if(!session_is_registered("bkarry")){
while($row2 = $this->dsql->GetArray("bkarry"))
{
$bkarry[]=$row2;
}
$bkarry2=serialize($bkarry);
$_SESSION['bkarry']=$bkarry2;
}else{
$bkarry=unserialize($_SESSION['bkarry']);
}
//unset($_SESSION['bkarry']);
//var_dump($bkarry);
while($row = $bkarry)
{var_dump($row);
}
exit();
while($row = $bkarry) {
var_dump($row);
}
session_start();
$query ="select * from #@__arctype where isbaike=1";
if(! isset($_SESSION['bkarry'])) {
$this->dsql->Execute("bkarry",$query);
while($row2 = $this->dsql->GetArray("bkarry"))
{
$_SESSION['bkarry'][] = $row2;
}
}
$bkarry =& $_SESSION['bkarry'];