Jump to content

Sort by the result value


RON_ron

Recommended Posts

statez : I need to sort the results from the high score to the low score.

 

$query = "SELECT statez, COUNT(statez)FROM distributors GROUP BY statez"; 
$results = mysql_query($query);
$returnS="";
while($line = mysql_fetch_array($results))
{
$returnS.= $line['COUNT(statez)'].",,".$line['statez'].",,,";
}
echo $returnS;
mysql_close($link);
?>

Link to comment
https://forums.phpfreaks.com/topic/212659-sort-by-the-result-value/
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.