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@xxxxxxxxxxxxx] 发送时间: 2004年12月9日 10:15 收件人: Jerry Swanson 抄送: PHP List 主题: Re: 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php