Page 1 of 1
what's the purpose of the '@' in '@mysql_connect(...)'?
Posted: Mon Oct 28, 2002 2:19 pm
by left-click
I am still new to php and I have already seen this
@ quite a few times, but I can't seem to find it in the manual.
Also, I have tried the mysql_* functions without the
@ prefixing them and they all seem to work fine. Can anyone tell me what exactly is the purpose of the @ before these function call
Cheers,
left-click
Posted: Mon Oct 28, 2002 2:23 pm
by infolock
I think it's for encrypting... don't hold me to that quote though

Posted: Mon Oct 28, 2002 2:25 pm
by superwormy
@functionname() will suppress any error messages the function returns. So if you connect to the database with @mysql_connect, and the connection fails, it won't show any warning messages. But if you just use mysql_connect and it fails, it'll spit out lots of warning messages.
Posted: Mon Oct 28, 2002 2:34 pm
by infolock
that's kinda what I thought. However, I dunno about the last part of that comment. When I try and connect to MySQL and it fails, I don't get any error messages at all. Only way I know to get it to error, is to put a "or die("blah blah blah ERROR R4R"); clause in it heh..
Posted: Mon Oct 28, 2002 2:35 pm
by TwinkiE_HunteR-G
The '@' is to supress any error messages that call may produce, so you can output one of your own.
Posted: Mon Oct 28, 2002 2:55 pm
by f1nutter