note 29447 deleted from language.basic-syntax.comments by didou
| From: | didou@php.net | Date: | Thu, 25 Sep 2003 12:47:07 +0000 |
| Subject: | note 29447 deleted from language.basic-syntax.comments by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57092@lists.php.net to get a copy of this message | ||
Note Submitter: xian@m-audio.com
----
In creating debugging comments, (or any kind really) I find it useful to creating appending
variables:
e.g.
<?
$sql = "SELECT * FROM table";
mysql_query($sql,$db);
$debug .= 'Block 1';
$debug .= $sql;
$debug .= mysql_error();
?>
NOTE: Useful to add html to format the messages.
After all the code has been documented, all one has to do is determine whether or not the message
variable is printed. Less code to change all around when you want to hide the debugging messages:
e.g.
<?
print $debug;
?>
or
<?
//print $debug;
?>