@NogDogFeb 10.2009 — #I'm not really sure what the question is here, but if you want your script to display all run-time errors: [code=php] <?php ini_set('display_errors', 1); error_reporting(E_ALL); [/code] Note that if display_errors is turned off by the PHP configuration, then parse errors still will not be displayed, as they are generated [i]before[/i] any code - including the above - is actually executed by the script.
@NogDogFeb 11.2009 — #Generally speaking, your production (i.e. "live") host environment should have [b]display_errors[/b] turned off so that no PHP error messages get displayed, both for security and because it looks bad. You should have the [url=http://www.php.net/manual/en/errorfunc.configuration.php#ini.log-errors]log_errors[/url] turned on and the [url=http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-log]error_log[/url] setting pointing to the desired log file so that you can review it for errors. [b]error_reporting[/b] should then still be set at a high enough level to see all errors [i]in that log file[/i] that you might be interested in (I'd normally suggest leaving it at [b]E_ALL[/b], or [b]E_ALL & ~E_NOTICE[/b] if you have sloppy code that generates lots of notices, but hopefully you don't ? ).
In any case, you should not depend on the built-in error reporting in any way for your application: such errors indicate a fault in the code, not a user error. You should be writing defensive code that prevents such errors from happening.
Bad: [code=php] $result = mysql_query($sql) or die(mysql_error() . "<br />n$sql"); while($row = mysql_fetch_assoc($result)) { [/code] Better: [code=php] $result = mysql_query($sql); if($result == false) { error_log(mysql_error()."n$sql"); echo "<p class='error'>Sorry, there was a database error which has been logged.</p>"; } else { while($row = mysql_fetch_assoc($result) { // etc... } [/code]