Run a while loop on your data and pull it into an array....

Heres an example (though this pulls from a text file the idea is the
same...) Hope this helps...

function read_data($datafile) {
        foreach ( $data as $line ) {
                $temp=explode(':', $line);
        if ( is_array($return) ) {
        } else {

 // USING THE DATA              
        if ( $hosts != 'NULL' ) {
                foreach ( $hosts as $host ) {
                        $temp=explode(':', $host[0]);
                        foreach ( $host as $hst ) {
                                $temp=explode(':', $hst);
display_host($hst, $count),
        } else { 
                $hosts="No Hosts In Database...<br>";

-----Original Message-----
Sent: Saturday, March 30, 2002 4:22 PM
To: php
Subject: [PHP] Pulling data into an array and sorting

I need to pull data into and array from a mysql database and then sort
that data according to one of the fields and then print it to the

Hear is an example of the data in the database

username     Pnumber     sec2 sec3 sec4 sec5 sec6
 Gary      123.345.122    YES  YES   NO  YES  YES
 Fred      123.345.123    YES  YES   NO  YES  YES
 Jone      123.345.124    YES  YES   YES  NO  YES
 Tom       123.345.124    YES  YES   NO  YES  YES
 Frank     123.345.123    YES  YES   NO  YES  YES

 If you will notice the Pnumber for some are the same and some are
 different. I what to be able to sort on this number and then when they
 are printed they would be printed according to this number in groups


Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to