如何订购此结果?从MySQL中选择类似的值并命令结果
$range = 5; // you'll be selecting around this range.
$min = $rank - $range;
$max = $rank + $range;
$limit = 10; // max number of results you want.
$result = mysql_query("select * from table where rank between $min and $max limit $limit");
while($row = mysql_fetch_array($result))
{
echo $row['name']." - ".$row['rank']."<br>";
}
请使用“101010”-Icon格式化您的代码。 – Simon 2010-05-15 07:57:06
是不是应该是ORDER BY? – 2010-05-15 07:59:07