Jump to content


Photo

mysql_query vs @mysql_query ?


  • Please log in to reply
2 replies to this topic

#1 ryel01

ryel01
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 22 March 2006 - 07:19 AM

Hello!

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


mysql_query($query)

and

@mysql_query($query)


?

Thanks!

Regan.

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 22 March 2006 - 12:59 PM

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

#3 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 22 March 2006 - 01:03 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users