Should you always end mysql queries with “or die?”

前端 未结 6 1903
野的像风
野的像风 2020-12-19 10:09

Example queries in some tutorials ALWAYS end with:

or die(mysql_error());  

I can see why you would would sometimes want to do this, but t

6条回答
  •  执笔经年
    2020-12-19 11:03

    You don't necessarily need

    or die()
    

    But you should have some kind of error handling system. If you don't have one in place yet, I would add it to my queries, even the simple ones.

    EDIT: To clarify, by "it" I mean the or die() statement.

提交回复
热议问题