Store array as Session Variable
| From: | Pushpinder Singh Garcha | Date: | Mon, 28 Jul 2003 19:18:06 +0000 |
| Subject: | Store array as Session Variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157225@lists.php.net to get a copy of this message | ||
hello All,
I am trying to store an array as a session variable.
while ($row = mysql_fetch_array($result))
{
if ( !is_array($company_name) ) $company_name = array(); array_push($company_name, $row['company']);// try to register session variable
$_SESSION['link'] = $company_name;} Now when I try to access this session variable in another file...I am getting a junk value.I am not sure if I am getting this right. $details = $_SESSION['link']; echo "LINK: ".$details."<br>"; Can some one fill me in on this. Appreciate it ! Thanks in advance. --Pushpinder Singh