count统计后的排序有关问题
Jun 13, 2016 am 10:57 AM
count统计后的排序问题
$sql=$empire->query("select userid,username from {$dbtbpre}enewsmember where groupid=1 and checked=1");
while($ur=$empire->fetch($sql))
{
$num=$empire->gettotal("select count(*) as total from phome_ecms_news where checked=1 and ismember=1 and userid='$ur[userid]'");
echo $ur['userid'].$ur['username'].$num;
}
?>
如何接照$num降序排序
------解决方案--------------------
to #8 php 已经提供了强大的函数,为什么不用?
- PHP code
$arr['uid'] = array(1,2,3,4,5,6);$arr['name'] = array('a1','a2','a3','a4','a5','a6');$arr['num'] = array(5,50,60,10,66,44);array_multisort($arr['num'], $arr['name'], $arr['uid']);print_r($arr);<div class="clear"> </div>

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Sort array using Array.Sort function in C#

Simple and clear method to use PHP array_merge_recursive() function

How to use the array_combine function in PHP to combine two arrays into an associative array

Detailed explanation of PHP array_fill() function usage

How to use the Array module in Python

What are the common causes of ArrayStoreException in Java?

Introduction to how to use the PHP array_change_key_case() function
