I have no problem connecting to a database using PHP however in some scripts I have tested, I have seen a small difference in the connect command.
What is the difference between @mysql_connect
and mysql_connect
?
I have never used the @
symbol when writing my own script so was just wondering if it served a purpose.
Thanks in advance
@
is the php equivalent of VB'son error resume next
e.g. "Who cares if the universe just exploded and everyone's dead. let's pretend everything's fine and continue shooting ourselves in the foot".mysql_*
functions for new code. They are no longer maintained and the community has begun the deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide, this article will help to choose. If you care to learn, here is good PDO tutorial.