Home > Backend Development > PHP Tutorial > Source code for making rankings in php+mysql_PHP tutorial

Source code for making rankings in php+mysql_PHP tutorial

WBOY
Release: 2016-07-13 17:23:25
Original
1125 people have browsed it

//Complete source code for ranking list
//You can decide the top XX by yourself! The number entered is the number of top




if ($top){ if ($top){
$query="select count(*) as total from data";
$result=mysql_query($query);
$message_count=mysql_result($result,0,"total");
if ($key>$message_count) {$key=$message_count;}

?>


Hot News Access Ranking




Top News Access Ranking Top

Ranking News Title
Category
Popularity


$query="select id,detail,title,hits,type from data order by hits desc limit 0,$key";
$result =@mysql_query($query);
$rows=@mysql_num_rows($result);
$i=1;

while($myrow=@mysql_fetch_array($result)){
?>
$myrow[title]
$myrow[type]
$myrow[hits]" ?>

$i++;
if ($i}
?>
News Popularity Ranking Top
>
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template