Jump to content

Archived

This topic is now archived and is closed to further replies.

ryel01

mysql_query vs @mysql_query ?

Recommended Posts

Hello!

I was wondering if anyone could explain what the difference is between using:


mysql_query($query)

and

@mysql_query($query)


?

Thanks!

Regan.

Share this post


Link to post
Share on other sites
The "@" symbol supresses error messages and shouldn't be used when developing code. I feel it shouldn't be used at all except in cases where you know you can safely ignore all errors that could result from the line preceded by the symbol. Always write your scripts defensively -- assume the worst and write code that will work correctly.

Ken

Share this post


Link to post
Share on other sites
I never use @, I just turn error_reporting down when a script is ready to go live. Generally you don't want users to see error messages because they look ugly and provide information about your application that could potentially be used to hack you.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.