<?php
$month = $_POST['month'];
$day = $_POST['day'];
$dbc = mysqli_connect('localhost','root','12345','user') or die ("连接数据库失败!");
$query = "select * from knowledge where month=$month and day=$day";
$result = mysqli_query($dbc,$query) or die ("查询失败!");
while($row = mysqli_fetch_array($result)){
$image = $row['image'];
$history = $row['history'];
$simple = $row['simple'];
$txt = $row['txt'];
echo "<div id=search_result_banner>".
     "<div id=search_result_img><table><tr height=300px><td width=250px background=$image></td></tr></table></div>".
 "<div id=search_result_simple><font size=3></br>简要:</br>$simple</font></div>".
     "<div id=search_result_history><font size=3>相关历史背景:</br>$history</font></div>".
 "</div>".
 "<div id=search_result_txt></br></br><font size=2>&nbsp;&nbsp;&nbsp;&nbsp;$txt</font></td>".
 "<div id=footer>版权所有</div>";
}
mysqli_close($dbc);
?>
下面是用到的样式表
#search_result{ width:1024px;  margin:10px auto; text-align:left;}
#search_result_banner{ width:1024px; height:300px; margin:0px auto;}
#search_result_img{ width:250px; height:300px; margin:0px auto; float:left;}
#search_result_history{ width:300px; height:300px; margin:10px auto; background:#b3b1ae; float:right;}
#search_result_simple{ width:300px; height:300px; margin:10px auto; text-align:left; background:#b3b1ae;}
#search_result_txt{width:1024px; margin:30px auto; background:#b3b1ae;}