include("top_news.php"); ?>
| |
Topic |
No.
of articles |
No.
of replies |
Most
recent reply |
$sql_category="select * from bbs_firstclass order by firstclass_order";
$query_category=mysql_query($sql_category, $connect);
while($array_category=mysql_fetch_array($query_category)){
echo "";
echo "| =-=>".$array_category["firstclass_enname"]." | ";
echo " ";
echo "";
echo " | ";
echo "";
echo "".$array_category["firstclass_enname"]." ";
echo "".$array_category["firstclass_desc_en"]." | ";
$sql_article="select * from bbs_article where firstclass_id=".$array_category["firstclass_id"];
$query_article=mysql_query($sql_article, $connect);
$article_num=mysql_num_rows($query_article);
echo "".$article_num." | ";
$sql_reply="select * from bbs_reply where firstclass_id=".$array_category["firstclass_id"]." order by reply_time desc" ;
$query_reply=mysql_query($sql_reply, $connect);
$array_reply=mysql_fetch_array($query_reply);
$reply_num=mysql_num_rows($query_reply);
echo "".$reply_num." | ";
if($array_reply=mysql_fetch_array($query_reply)){
echo ""."[ ".$array_reply["reply_user"]." ]".""." ";
echo date(Y, $array_reply["reply_time"])."-".date(m, $array_reply["reply_time"])."-".date(d, $array_reply["reply_time"]);
echo " | ";
}
else{
echo " | ";
}
echo " ";
}
?>
|