日期:2013-01-06  浏览次数:20523 次

本论坛总共用了不到200行代码,执行速度相当快。运行例子在:http://www.hnpts.ha.cn/forum
MYSQL数据库:yxforum
+-------+--------------+------+-----+---------+----------------+  
| Field | Type         | Null | Key | Default | Extra          |  
+-------+--------------+------+-----+---------+----------------+  
| id    | int(11)      |      | PRI | 0       | auto_increment |  
| dt    | datetime     | YES  |     | NULL    |                |  
| tp    | varchar(255) | YES  |     | NULL    |                |  
| ct    | text         | YES  |     | NULL    |                |  
| fl    | int(11)      | YES  |     | NULL    |                |  
| ip    | varchar(20)  | YES  |     | NULL    |                |  
| un    | varchar(50)  | YES  |     | NULL    |                |  
| em    | varchar(60)  | YES  |     | NULL    |                |  
| num   | int(11)      | YES  |     | NULL    |                |  
+-------+--------------+------+-----+---------+----------------+  

index.php:  

<html>  
<head>  
<style type="text/css">  

<!--  
.unnamed1 {  font-size: 9pt; font-family: "宋体"}  
.unnamed1 A {COLOR: #000088; FONT-SIZE: 9pt; TEXT-DECORATION: none; TEXT-TRANSFORM: none; font-family: "宋体"}  
.unnamed1 A:hover {COLOR: #880000; FONT-SIZE: 9pt; TEXT-DECORATION: underline overline; font-family: "楷体_GB2312"}  
.unnamed2 {  font-size: 12px; color: #9933FF}  

-->  

</style>  
</head>  
<body bgcolor="#FFFFFF" text="#000000" link="#000066" vlink="#0000CC" alink="#000099">  
<?$m=mysql_connect("localhost","××××","××××");  
  mysql_select_db("××××",$m);  
?>  

<?if ($fl=="") $fl=1;  
$hf_fl=$fl;  
$q="select * from yxforum where id=".$fl;  
$mr=mysql_query($q,$m);  
$ra=mysql_fetch_row($mr);  
?>  
<p align=center><b><?print($ra[2]);?></b>