Error handling in PHP

后端 未结 9 1702
长情又很酷
长情又很酷 2020-12-02 08:40

I\'m familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especia

9条回答
  •  甜味超标
    2020-12-02 09:11

    Rather than outputing the mysql_error you might store it in a log. that way you can track the error (and you don't depend on users to report it) and you can go in and remove the problem.

    The best error handling is the kind that is transparent to the user, let your code sort out the problem, no need to involve that user fellow.

提交回复
热议问题