@mysql_query - whats the difference between this and mysql_query?
@mysql_query - whats the difference between this and mysql_query?
am 09.02.2006 13:12:49 von r-jones
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
Re: @mysql_query - whats the difference between this and mysql_query?
am 09.02.2006 13:16:51 von D
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. :)
Re: @mysql_query - whats the difference between this and mysql_query?
am 09.02.2006 13:21:30 von r-jones
cheers very much
great help
Re: @mysql_query - whats the difference between this and mysql_query?
am 09.02.2006 14:19:38 von Shion
d wrote:
> 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
Re: @mysql_query - whats the difference between this andmysql_query?
am 10.02.2006 16:25:52 von Jamie Davison
On 2/9/06 7:12 AM, in article
1139487169.480653.33110@z14g2000cwz.googlegroups.com, "r-jones@orange.net"
wrote:
> 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
>
The @ directive simply suppresses the errors, if any, returned. Not
something you will want to use as a newbie.