seesion_register() with arrays
| From: | Douglas - IG | Date: | Fri, 31 May 2002 23:17:15 +0000 |
| Subject: | seesion_register() with arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-100189@lists.php.net to get a copy of this message | ||
Hi All,
I´m trying to register into a session an array which has returned from a mysql_fetch_array
function. But when I call $array it returns empty or something like this.
Do you know how can I do this operation?
Regards!
Here go my scripts:
<?
# script1.php4
session_start();
$sql = "select * from table1";
$result = mysql_query ("$sql");
...
<form name="form1" method="post" action="test.php4?session_id=<?echo
session_id();?>">
while ($array = mysql_fetch_array($result))
{...}
session_register ("array");
?>
<?
# script2.php4
session_start($session_id);
if (session_is_registered("array"))
{
while ($array) {
echo $array["fieldname"];
}
}
else { echo "Error<br>"; }
?>