error_reporting(0)无法正常工作 [英] error_reporting(0) not working

查看:382
本文介绍了error_reporting(0)无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我目前正在生产环境中开发,因为没有开发测试环境。



问题是每当有任何sql错误时,它会在浏览器上向用户显示数据库,表名的错误,我认为这是不对的。



我检查过phpinfo()并说它 -



error_reporting 22527

display_errors off





我也尝试添加error_reporting(0)但没有成功。



Hello,

I am currently developing in production environment as there is no test environment for development.

The problem is whenever there is any sql error, it displays the error with database, table name on the browser to the user, which i think isn''t right.

I have checked the phpinfo() and it says -

error_reporting 22527
display_errors off


I have also tried adding error_reporting(0) with no success.

<?php 

error_reporting(0);
require_once(''connection.php'');


mysql_select_db($db, $test);

$query =  "Select * from testtable";
$result = mysql_query($query, $test) or die(mysql_error());
$num_rows = mysql_num_rows($result);


?>

and user get the error  -

"Table ''db.testtable'' doesn''t exist" 





有什么想法吗?



谢谢



Any ideas?

Thanks

推荐答案

db,


test);


query =从testtable中选择*;
query = "Select * from testtable";


这篇关于error_reporting(0)无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆