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

前端 未结 6 1912
野的像风
野的像风 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 10:48

    It depends on what you mean by "shouldn't be a problem".

    If you mean "well it won't fail", what happens if the database server goes offline?

    Only if you mean "It doesn't matter whether it fails or not, the script can keep running without a problem" that you should consider not having the or die there.

提交回复
热议问题