This is a similar problem, but different for several reasons.
I'm customizing a copy of phpHoo2 (see,
http://www.cable-modems.org/phpHoo/ if you are unfamiliar with it. Great for hierarchical databases.
I've added a column to the Links table called "OnTop", if it is not null, then I want it displayed first, and the remaining results displayed randomly. I suppose the SubmitDate could be randomized, and used to sort on, but I'm not sure how
Here's the function that does the selection, and a remark, that might be helpful.
function get_Links($CatID = "")
{
if(empty($CatID))
{ $CatID = "= 0";
} else {
$CatID = "= $CatID";
$sql = "UPDATE Categories SET Views=(Views+1) WHERE CatID $CatID";
$results = $this->sql_query($sql);
// need to put OnTop option, on top, and randomize display order of remainder
// example: select category_description, rand() as rnd from category order by rnd;
$sql = "SELECT * FROM $this->LNK_TBL WHERE (Approved != 0) AND CatID $CatID ORDER BY OnTop, SubmitDate ASC";
$results = $this->select($sql);};
return $results; }
Any ideas would be greatly apreciated.