php-general | 2001072
Date: 07/27/01
- Next message: Wagner Tomy: "Re: [PHP] 2D array"
- Previous message: Wagner Tomy: "Re: [PHP] execution time"
- Next in thread: Wagner Tomy: "Re: [PHP] 2D array"
- Reply: Wagner Tomy: "Re: [PHP] 2D array"
- Reply: Randy Johnson: "[PHP] FORCING A PHP OUTPUT TO BE CACHED"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
I have been trying to do this for hours now.
I have a while loop (rows from mysql db) and on each pass I want to pussh
a new element into a 2D array, bot always end up with the last element of
the while loop. So:
table mytable
myname myphone myemail
john 254688 jonh <email protected>
tom 789787 tom <email protected>
$myquery="select * from mytable";
while ($myrow = mysql_fetch_array($myrows)) {
.. .. . . .
$my2darray = array ($myname => array ($myphone,$myemail));
}
$mycount=count(my2darray); // returns 1
while (list($key,$value) = each ($my2darray)) {
echo"$key,";
echo"$value[0]";
echo"$value[1]<br>";
// retuns only one row with tom,798779,tom <email protected>
}
How do I push multiple entries into a 2d array?
I tried $my2darray[]=array(.......
Regards
Ajdin
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Wagner Tomy: "Re: [PHP] 2D array"
- Previous message: Wagner Tomy: "Re: [PHP] execution time"
- Next in thread: Wagner Tomy: "Re: [PHP] 2D array"
- Reply: Wagner Tomy: "Re: [PHP] 2D array"
- Reply: Randy Johnson: "[PHP] FORCING A PHP OUTPUT TO BE CACHED"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

