Home >Backend Development >PHP Tutorial > 怎么实现从数据库读取后重新从1到10排序

怎么实现从数据库读取后重新从1到10排序

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:30:241509browse

如何实现从数据库读取后重新从1到10排序

$query = "select * from software order by cnet_total_downloads limit 10";<br />
$result = mysql_query($query) OR die(mysql_error());<br />
while($row = mysql_fetch_array($result))<br />
{<br />
echo "X.".$row['software_name'];<br />
}


想要的效果就是上面的X怎么变成1,2,3,4,5,6,7,8,9,10

最终显示
1. a
2. b
3. c
.
.
.
10.Z

这个1到10如何实现

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn