Re: Will not report errors what can I do
| From: | tedd | Date: | Fri, 05 Dec 2008 15:40:34 +0000 |
| Subject: | Re: Will not report errors what can I do | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284175@lists.php.net to get a copy of this message | ||
At 3:19 PM +0000 12/5/08, ceo@l-i-e.com wrote:
$result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__));That's what I call common code -- I type it once and after that it's all cut/paste. I have entire libraries of routines that I've used before -- I just cut/paste them into the new stuff as needed. Even many of the variable names remain the same so it becomes more a job of assembly more than typing. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com//==================== to show dB errors ====================== function report($query, $line, $file)I did this, briefly, but got tired of typing __LINE__, __FILE__ so much.{ echo($query . '<br>' .$line . '<br/>' . $file . '<br/>' .mysql_error());}This does two things: 1) It tells where the error took place (line/file); 2) and it provides a single place in my entire project to turn-off dB error reporting -- all I have to do is comment out a single line.