答复: [PHP] Pass mysql array into SESSION?

From: Date: Thu, 09 Dec 2004 07:12:23 +0000
Subject: 答复: [PHP] Pass mysql array into SESSION?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-203792@lists.php.net to get a copy of this message
Yes. And also look at your php.ini, if the session's name and path is not set , You must set it above session_start(); Like : session_name('test'); session_save_path("/homes/eric/temp"); session_start(); ....... -----邮件原件----- 发件人: Marek Kilimajer [mailto:lists@kilimajer.net] 发送时间: 2004年12月9日 10:15 收件人: Jerry Swanson 抄送: PHP List 主题: Re: [PHP] Pass mysql array into SESSION? Jerry Swanson wrote: > I want to pass an array from one page to excell generation page. I > tried to pass through session($_SESSION['sql'] = $var). But value is > not set. > > The array is actually $result = mysql_query($query); > did you call session_start() at the beginning of your scripts? Is the query executed without an error? Are there any rows returned? Start with something simple and see if it works: Page 1: session_start(); query database... print_r() the result store the result in session variable link to Page 2 Page 2: session_start(); print_r the session variable -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#203792) next »