Jump to content

[SOLVED] 2 ordery by's?


ohdang888

Recommended Posts

once you do that query you should put all the results into a array like this

<?php
$rs = mysql_query("SELECT `id`, `format` FROM `test` WHERE `cat`='$cat' ORDER BY `bid` DESC  LIMIT 4");
$rows = array();
while($row = mysql_fetch_assoc($rs)){
    $rows[] = $row;
}
shuffle($rows);
?>

the shuffle will randomize the 4 rows.

 

Scott.

Link to comment
https://forums.phpfreaks.com/topic/114472-solved-2-ordery-bys/#findComment-588607
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.