Ken2k7 Posted July 24, 2008 Share Posted July 24, 2008 What's the difference between the two lines: <?php $con = @mysql_connect("a", "b", "c"); ?> AND <?php $con = mysql_connect("a", "b", "c"); ?> Thanks in advance, Ken Quote Link to comment https://forums.phpfreaks.com/topic/116346-solved-difference-between-with-and-without/ Share on other sites More sharing options...
ratcateme Posted July 24, 2008 Share Posted July 24, 2008 if the first line gets an error it will be suppressed and the script will keep going and $con will = false in the second script if the connection fails some errors will be displayed(if display errors is on) Scott. Quote Link to comment https://forums.phpfreaks.com/topic/116346-solved-difference-between-with-and-without/#findComment-598243 Share on other sites More sharing options...
cooldude832 Posted July 24, 2008 Share Posted July 24, 2008 @ = don't use if you are asking questions because you will never know if u had errors The only realistic time to use the @ is if you have a site that is of importance to hide error messages (final bug free prodcuts) Quote Link to comment https://forums.phpfreaks.com/topic/116346-solved-difference-between-with-and-without/#findComment-598245 Share on other sites More sharing options...
MasterACE14 Posted July 24, 2008 Share Posted July 24, 2008 isn't really any reason to use @ at all, even for a finished product. It wouldn't be a finished product if it was still getting errors! Quote Link to comment https://forums.phpfreaks.com/topic/116346-solved-difference-between-with-and-without/#findComment-598250 Share on other sites More sharing options...
Ken2k7 Posted July 24, 2008 Author Share Posted July 24, 2008 Thanks for the answers. I'm making a script that's going to be implemented on a hosted forum for others to use. So having it not display any errors is great! I don't want people to freak out when they get some error messages. Thanks again, Ken Quote Link to comment https://forums.phpfreaks.com/topic/116346-solved-difference-between-with-and-without/#findComment-598258 Share on other sites More sharing options...
trq Posted July 24, 2008 Share Posted July 24, 2008 Thanks for the answers. I'm making a script that's going to be implemented on a hosted forum for others to use. So having it not display any errors is great! I don't want people to freak out when they get some error messages. Thanks again, Ken Then turn off display_errors in either your php.ini or at runtime using ini_set(). Quote Link to comment https://forums.phpfreaks.com/topic/116346-solved-difference-between-with-and-without/#findComment-598262 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.