<?php
include("gps.inc");
$con = db_con();
$hname=$_POST['hname'];
$hadd=$_POST['hadd'];
$htel=$_POST['htel'];
$qry1 = "insert into hotel(hname,hadd,htel) values('$hname','$hadd','$htel')";
mysql_query($qry1, $con);
$qry2 = "select * from hotel";
$res1 = mysql_query($qry2, $con);
$rnum = mysql_num_row($res1);
$fnum = mysql_num_fields($res1);
?>
<table width =200 border =1>
<?
for($i=0;$i<$rnum;$i++){
echo"<tr>";
for($j=0;$j<$fnum;$j++){
$d = mysql_result($res1,$i,$j);
echo "<td> $d</td>";
}
}
echo "[$rnum]个信息";
mysql_close($con);
</table> 这里为什么有错呢?
料青山看我应如是
相关分类