Code:
<?
require("admin/config.php");
$num_active = 10;
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$twentyfourhours= 24*60*60;
$date1 = time() - $twentyfourhours * 1;
$myselect = "select * from thread where lastpost > $date1 order by views desc limit 10";
$result = mysql_query($myselect);
if ($row = mysql_fetch_array($result)) {
do {
printf("<li><a href=\"http://www.gandmasti.com/forum/showthread.php?threadid=%d\">%s</a><br>%d views - %d replies</li>", $row[threadid], $row[title], $row[views], $row[replycount]);
} while ($row = mysql_fetch_array($result));
}
?>