RE: [PHP-DB] Supress MySQL error messages...
| From: | Matthew Horn | Date: | Tue, 27 May 2003 15:53:30 +0000 |
| Subject: | RE: [PHP-DB] Supress MySQL error messages... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28093@lists.php.net to get a copy of this message | ||
> Ex.
> $number = @mysql_num_rows($result_var);
>
> Having a bit of a brain cramp right now as I normally do not suppress
> errors. My apologies if I'm wrong.
The at sign works fine for suppressing error messages from mysql, but I usually have it at the
beginning of the assignment, as in:
@ $number = mysql_num_rows($result_var);
Is there any reason to do this versus the way Richard mentioned (having the @ before the mysql
statement)?
Are there any downsides to doing this at all? I understand it can make you lazy later on and not
bother doing error checking, for one...
matt