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
Avoid that at all cost!
mysql_error
may expose information you don't want to be givenImagine a database of transactions - your customer sends money, so you have to modify two tables (two queries).
First one transfers money from X to Y and succeeds. The second one has to subtract Y from X fails.
You have no way to revert the transaction and the error is not logged. Effectively making user Y happy and X left confuse where the money went...
Use a sensible error handling for queries - either make a class that will handle that for you or use ORM.