Hello,
I use this code :
$myarray= array();
session_register ("myarray");
$i=0;
while ($row = mysql_fetch_object($result)) {
$myarray[$i][0] = $row->ID;
$myarray[$i][1] = $row->NOM;
$myarray[$i][2] = $row->PRENOM;
$i = $i + 1;
}
for($i=0; $i<sizeof($myarray);$i++){ ?>
<a href="index.php?argumenthere=test&id=<?php echo($myarray[$i][0]); ?
>"><?php echo($myarray[$i][2]); ?></a>
<?php }
mysql_free_result($result);
mysql_close($link);
?>
That's work. But when I add an <a href="...."> to call an another page
(at the end of this) and in this another page I use axactly the same for
loop than in the previous code
<?php
for($i=0; $i<sizeof($myarray);$i++){ ?>
<a href="index.php?argumenthere=test&id=<?php echo($myarray[$i][0]); ?
>"><?php echo($myarray[$i][2]); ?></a>
<?php } ?>
I receive the error :
Notice: Undefined variable: myarray in ....
I solved the problem, I did that :
- register_globals = On
- use session_start(); on the top of the second page too
Is it normal ?
Bye
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php