[英]try catch in php pdo, doing it right way
I am using php pdo with postgres. 我在postgres中使用php pdo。 I am using core php, no mvc, no classes and objects.
我正在使用核心php,没有mvc,没有类和对象。 I have some doubts in my mind since i am new to development, :-
因为我是开发新手,所以我心中有一些疑问:-
And if i use try catch then should i exit the running script on exception 如果我使用try catch,那么我是否应该异常退出运行脚本
And is there a way to use one try catch for all queries, i mean making a common function for executing queries. 有没有一种方法可以对所有查询使用try try catch,我的意思是为执行查询提供一个通用函数。
please some one clear my doubts about this. 请有人清除我对此的怀疑。
There are too many questions and they are too generic. 问题太多了,它们太笼统了。 But in most cases:
但在大多数情况下:
I wrote an article where tried to explain all there matters, PHP Error reporting which you may find interesting. 我写了一篇文章,试图解释所有问题, PHP错误报告您可能会发现有趣。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.