|
Posted by J.O. Aho on 10/02/78 11:39
d wrote:
> <r-jones@orange.net> wrote in message
> news:1139487169.480653.33110@z14g2000cwz.googlegroups.com...
>> Sorry for the simplicity of the question, but im a newbie.
>>
>> Iv seen the mysql_query command written with an @ before it on some
>> example codes. What, if any, is the difference? And if they are
>> different, when should you use the @ and what does it do?
>>
>> Cheers
>
> Prefixing a function with an @ will hide any error message generated by the
> function. If a function will possibly fail, you can prefix it with the @,
> then check the return value to see if the function did infact work or not.
> It's kind of like a basic version of try/catch. Very basic. :)
It's quite useful if you have enabled error output to the php generated page
and there is something you don't want to the user to see, but of course in
that case it's better to turn off the error output and save errors to a log
file instead.
//Aho
Navigation:
[Reply to this message]
|