【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:9-7.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?
$link = mysql_connect("localhost","root","123456");
mysql_query("use db");
$sqlstr="select * from zip where zone ='".$_POST['zone']."'";
$result = mysql_query($
sqlstr,$link);
echo "<center>以下是 ".$_POST['zone']."的邮政编码数据<br><p>";
echo "<table border=1>\n";
echo "<tr>\n";
/* 印出表头 */
while ($field =
mysql_fetch_field($result)) {
echo "<td>".$field->name."</td>\n";
}
echo "</tr>\n";
/* 打印表身 */
while ($row = mysql_fetch_row($result)) {
echo "<tr>\n";
for($i=0;$i<count($row);$i++){
echo "<td>".$row[$i]."</td>";
}
echo "</tr>\n";
}
echo "</table>\n";
echo "</center>";
mysql_free_result($result);
mysql_close($link);
?>