$array only contains one of the result rows, not all of them. At least
it's that way in your script. Try to register the variable before you
start assigning values to it and you'll have to add each row into an
array in order to save the entire result set.

---John Holmes...

> -----Original Message-----
> From: Douglas - IG [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 7:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] seesion_register() with arrays
> 
> 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>"; }
> ?>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to