Home  >  Article  >  Backend Development  >  php错误处理机制如何解决

php错误处理机制如何解决

WBOY
WBOYOriginal
2016-06-13 11:51:53887browse

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

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

Statement:
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