關鍵代碼
<?php
header("Content
header("Conten
?>
第一句是用來聲明文件內容的格式
實現代碼
<meta http
<?php
header("Content
header("Conten
?>
<table width="
<tr>
<td colspan="
</tr>
<tr>
<td>編號</td>
<td>姓名</td>
<td>年齡</td>
</tr>
<tr>
<td>
<td>test</td>
<td>
</tr>
<tr>
<td>
<td>test
<td>
</tr>
</table>
當然
答案是可以的
實現代碼
<meta http
<?php
header("Content
header("Content
mysql_connect("localhost"
mysql_select_db("test");
mysql_query("SET NAMES GBK");
$query="select * from city ";
$r=mysql_query($query);
?>
<table width="
<tr>
<td colspan="
</tr>
<tr>
<td align="center">id</td>
<td align="center">p_id</td>
<td align="center">name</td>
</tr>
<?php
while($row=mysql_fetch_assoc($r)){
?>
<tr>
<td><?php echo $row[id] ?></td>
<td><?php echo $row[p_id] ?></td>
<td><?php echo $row[c_name]?></td>
</tr>
<?php
}
?>
</table>
From:http://tw.wingwit.com/Article/program/PHP/201311/20901.html