Home > Backend Development > PHP Tutorial > 请问怎样把mysql_error和php的error_reporting()同输出一个文件或者异常日志

请问怎样把mysql_error和php的error_reporting()同输出一个文件或者异常日志

WBOY
Release: 2016-06-13 12:07:19
Original
1240 people have browsed it

请教怎样把mysql_error和php的error_reporting()同输出一个文件或者错误日志
网站需要看到 出现错误时同时记录 mysql_error和php的error_reporting()错误到一个 文件 或者自动写入 数据库 以便查看什么时候发生什么错误, 有什么方法可以解决????
------解决思路----------------------
你自己定义格式就可以了啊!
有错误了记录到文件中
------解决思路----------------------

$rs = mysql_query($sql) or trigger_error(mysql_error());
Copy after login

------解决思路----------------------
看apache log就可以了。错误的都保存在里面,mysql与php的都是。
------解决思路----------------------
请查看php的error_log函数

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