大家帮忙看下这段查询数据库的代码
<?php
error_reporting(0);
include'xhtml/xhtmlt.php';
$con=mysql_connecting("localhost:3306","root","");
if(!$con){
die("数据库连接失败!".mysql_error());
}
mysql_select_db("zitan",$con);
$result=mysql_query("select * from bbs");
if($result===null){
echo'查询目标无数据提取!';
}
echo'版块:
<table border="1"><tr><th>bk</th><th>bzid</th><th>id</th><th>tzid</th></tr>';
while($row=mysql_fetch_array($result)){
echo'<tr>';
echo'<td>'.$row["bk"].'</td>';
echo'<td>'.$row["bzid"].'</td>';
echo'<td>'.$row["id"].'</td>';
echo'<td>'.$row["tzid"].'</td>';
echo'</tr>';
}
echo'</table>';
mysql_close($con);
?>
</body>
</html>
执行后显示空白,怎么回事?
第一次靠自己与数据库挂钩,
有很多不明白的,求解,谢谢
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
ini_set('display_errors',true);
这样你就能看到错误提示了。
如果你不是高手,不要用error_reporting(0);屏蔽错误信息。