php - Should you always end mysql queries with "or die?" -


Example queries end in some tutorials:

  or die (mysql_error ( ));  

I can see that you sometimes want to do this, but they also use it for questions which should not really cause any problem. Is it always a good practice to use it, or are they just doing it to help you learn it?

itemprop = "text">

No

Avoid at all costs!

  1. This is a horrible message to show the end user
  2. The first transfers money from X to Y and succeeds, secondly, it will have to subtract X from wi fail .

    You have no way to return the transaction and the error is not logged. Effective user u happy and left x, where money went confused ...

    Use a sensible error management for questions - either to create a class that uses ORM for you or Will do


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -