At 3:19 PM +0000 12/5/08, [EMAIL PROTECTED] wrote:
 > $result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__));

 //====================  to show dB errors  ======================

 function report($query, $line, $file)
     {
    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.

I did this, briefly, but got tired of typing __LINE__, __FILE__ so much.


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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to