Re: Store data in array

From: Date: Mon, 18 Mar 2002 13:45:55 +0000
Subject: Re: Store data in array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-88921@lists.php.net to get a copy of this message
It is showing "Array" probably because you do echo $rows; and because $rows is array you receive "Array"; try foreach($rows as $k=>$v){ print "\n[$k][$v]<br>"; } Regards, Andrey ----- Original Message ----- From: "Uma Shankari T." <umashankari@lantana.tenet.res.in> To: "Andrey Hristov" <ahristov@icygen.com> Cc: <php-general@lists.php.net> Sent: Monday, March 18, 2002 1:24 PM Subject: Re: [PHP] Store data in array > > > On Mon, 18 Mar 2002, Andrey Hristov wrote: > > AH>If it is possible do the sorting in the SQL statement by using ORDER BY. SQL sorting is > AH>much faster than in PHP. > AH>However > > I have gone through that manual already....but i need to sort by php > sorting. > > AH>while ($row= mysql_fetch_assoc($res)){ $rows[] = $row; } > AH> > > I have tried this but while sorting using php sort it is displaying array > only.If the elements are stored in the array properly i can perform > sorting. > > please tell me how to extract a specific field from mysql database and > store it in array... > > AH>Then you have many ways to sort. Look at : sort(), asort(), arsort(), usort(), uasort() > AH>etc. > AH> > AH>Best regards, > AH>Andrey Hristov > AH> > AH>----- Original Message ----- > AH>From: "Uma Shankari T." <umashankari@lantana.tenet.res.in> > AH>To: <php-general@lists.php.net> > AH>Sent: Monday, March 18, 2002 12:25 PM > AH>Subject: [PHP] Store data in array > AH> > AH> > AH>> > AH>> > AH>> Hello, > AH>> > AH>> Anyone can please tell me how to store the row details fetched from > AH>> database to array so that to sort the same array after storing.... > AH>> > AH>> > AH>> -Uma > AH>> > AH>> > AH>> -- > AH>> PHP General Mailing List (http://www.php.net/) > AH>> To unsubscribe, visit: http://www.php.net/unsub.php > AH>> > AH>> > AH> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#88921) next »