Jump to content

[SOLVED] Prioritize record selection


sahel

Recommended Posts

I have a set of records that i select randomly...i now have a situation where i have to prioritize some records.

 

I want to make the selection to be able to prioritize the record order, i want high priority records to be shown on top based on a 0-100 (percent) priority.

 

How can this be done??

Let me know if you have any questions.

 

Talker.

 

Link to comment
https://forums.phpfreaks.com/topic/114290-solved-prioritize-record-selection/
Share on other sites

Here is what i have come up with.. just a thought, need your professional advice.

 

I can add a priority column and specify the % of priority. Table data would be like:

id--value--priority

1--a--0

2--b--0

3--c--25

4--d--25

5--e--100

6--f--100

7--g--100

 

..and doing a select ordered by priority would give me..

id--value--priority

5--e--100

6--f--100

7--g--100

3--c--25

4--d--25

1--a--0

2--b--0

 

... correct? i hope so. There is only one thing that i want added.. i want them randomized within the priority.

so that the three 100% records come up randomized, the 2 25% ones randomize and the 0% randomize too..

 

How can that be done?

 

 

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.