Unimatic1140 has asked for the wisdom of the Perl Monks concerning the following question:
Can anyone show me how to sort this descending? Big thanks in advance.##SELECT DATA FROM DATABASE AND FILL IT INTO A HASH $sth = $dbh->prepare("SELECT * FROM $table_POSTS WHERE Thread = '$Sent +Thread'"); $sth->execute(); $sth->bind_columns(\$THREADd, \$POSTd, \$FORUMd, \$USERNAMEd, \$CREATE +Dd, \$REPLIEDd, \$TITLEd,\$DRIFTd, \$LINKd, \$JPEGd, \$COMMENTSd, \$I +Pd, \$REMd, \$OFFENSIVEd ); while($sth->fetch()) { $view{$POSTd} = { 'thread' => $THREADd, 'post' => $POSTd, 'forum' => $FORUMd, 'username' => $USERNAMEd, 'created' => $CREATEDd, 'replied' => $REPLIEDd, 'title' => $TITLEd, 'drift' => $DRIFTd, 'link' => $LINKd, 'jpeg' => $JPEGd, 'comments' => $COMMENTSd, 'ip' => $IPd, 'rem' => $REMd, 'offensive' => $OFFENSIVEd }; ###PRINT THE POST NUMBERS ASCENDING foreach $view2 ( sort keys %view ) { $POST = $view{$view2}->{'post'}; print "$POST<br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Shouldn't this sort be simple?
by almut (Canon) on Mar 03, 2010 at 22:37 UTC | |
by Unimatic1140 (Novice) on Mar 03, 2010 at 22:52 UTC | |
|
Re: Shouldn't this sort be simple?
by ww (Archbishop) on Mar 03, 2010 at 22:49 UTC | |
|
Re: Shouldn't this sort be simple?
by jrsimmon (Hermit) on Mar 03, 2010 at 22:39 UTC |