不显示mysql错误提示

WBOY
Release: 2016-06-23 14:00:13
Original
1630 people have browsed it

有10个checkbox。9个不打勾时,值为null,数据库就报错


回复讨论(解决方案)

怎么在网页上隐藏mysql.让访问服务器的用户看不到错误

没有被选中的 checkbox 不会被提交

但测试的时候会显示mysql的错误提示,我不希望访问网页的用户都看到mysql的错误提示

你排除了错误,不就没有错误显示了吗?

加这两句试试,不建议使用错误抑制符@。

<?phpini_set('display_errors', 'off');error_reporting(0);?>
Copy after login

但测试的时候会显示mysql的错误提示,我不希望访问网页的用户都看到mysql的错误提示
修改php.ini
error_reporting: E_ALL & ~E_DEPRECATED 
display_errors:Off

这药方疗效是临时的,但看病得治根

因为我需要接受所有的checkbox判断是否为null,如果不是就讲相应的value值存起来,只要我定义了变量而我在接受过程中变量的值为null就会报错

急求高见!!!!!!!!!!!!!!!!!!!!!

屏蔽错误检查是自欺欺人的做法
你需要自己检查出可能出现的各种错误
而一般教程示例的代码都是不含错误检查的代码

你可以贴出你的代码看看

mysql 的错误 应该很容易 解决!

error_reporting

数据库字段是 not null限制?这样插入NULL值时当然会有错误。

程序里要有对可能出现的非法数据进行过滤,同时数据库的设计要和提交的数据一致。

谢谢,楼上诸位的回答,我再试试

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!