Jump to content

[SOLVED] Double Sort/Order...


iPixel

Recommended Posts

Ok here we go ..

 

Ive got this DB table, and it looks like this:

Fields

=====

priority

model

desc

vendor

status

complete

pm

timestamp

date

new

 

now i need to sort this twice.. the first sort is by prioritywhich ranges from 1 to 10,

1 being most important 10 worst. And the second sort has to be by timestamp which

has to be in order from latest entered record first then earliest and so on.

 

naturally the first sort will be in the query

$Qquery = "SELECT * FROM photoqueue ORDER BY priority ASC";
$Qsql = mysql_query($Qquery) or die('Queue Query Error : ' . mysql_error());
$Qresult = mysql_fetch_assoc($Qsql);

 

So im not sure whats best to do now ...

 

1. Enter the results into and array and resort it there before dynamically echo'ing the results.

2. Some other way im not aware of ...

 

my problem is #1... im not too sure how to go about doing this ...

 

Thanks in advance for all the help.

~iPixel

Link to comment
https://forums.phpfreaks.com/topic/69955-solved-double-sortorder/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.