I want something like this:
or function() { echo mysql_error().'<br>'; } // doesn't work
Instead of:
or die(mysql_error());
I want to continue the execution of the script, not to “die”. Can’t I use the anonymous function that way? I just woudn’t like to name it.
EDIT/TIP: For creating anonymous functions, there’s a lambda-style function called create_function…
though printing it out is almost bad as dying.
In the perfect world it would be
always do it that way. You’ll get not only filename and line number (which is MIGHTY helpful when you have plenty of queries on the page) but also will keep sensitive information secret on the production server, where you will turn displaying errors off and logging – on.