php错误处理机制如何解决

WBOY
Release: 2016-06-13 11:51:53
Original
891 people have browsed it

php异常处理机制怎么解决
想写一个PHP执行mysql语句出错时的监控程序,用了 try{}catch{}为什么没有效果,请帮忙指导下。
------解决方案--------------------
php 的 mysql 函数先于 php 的 try catch 结构出生

------解决方案--------------------
当错误发生时,php默认抛出错误而不是异常。
查阅set_error_handler 的相关内容
------解决方案--------------------
直接在可能出错地方,加个判断。

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!