<?php
	function top_pages ($list,$number,$name){

		$top = mysql_query("SELECT * FROM `$list` ORDER BY `$number` DESC LIMIT 0,10");

		while($sql = mysql_fetch_array($top)){

			$i++;
			$code .= '<tr><td>'.$i.'</td><td>'.$sql[$name].'</td><td>'.$sql[$number].'</td><tr>';

		}

		return $code;

	}