Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.