Home  >  Article  >  Backend Development  >  读取session中数组有关问题

读取session中数组有关问题

WBOY
WBOYOriginal
2016-06-13 12:30:49861browse

读取session中数组问题

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

从session中取出数组后就循环不了了  报内存不足
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1176 bytes)

大侠们帮帮忙 看看哪有问题  或者能更简单写 

我想实现    查询数据有3000多条 每次都查就太慢了 所以想存到session中调用不用每次都查 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn