colap Posted November 3, 2009 Share Posted November 3, 2009 Do i have to use '@' before mysql_connect and other fuction inside class? class mm{ $con=mysql_connect("$v_host","$v_user","$v_database_name")or die('Could not connect: ' . mysql_error()); } Quote Link to comment https://forums.phpfreaks.com/topic/180201-solved-do-i-have-to-use-before-mysql_connect-and-other-fuctions-inside-class/ Share on other sites More sharing options...
MadTechie Posted November 3, 2009 Share Posted November 3, 2009 No, @ does 1 thing only.. omit errors.. Personally I don't use it, (unless its personal code and I'm being lazy) Quote Link to comment https://forums.phpfreaks.com/topic/180201-solved-do-i-have-to-use-before-mysql_connect-and-other-fuctions-inside-class/#findComment-950604 Share on other sites More sharing options...
corbin Posted November 4, 2009 Share Posted November 4, 2009 Typically the use of @ is bad. It's slower than without it, and it suppresses errors. Isn't it better to fix them than suppress them? Typically I just silently log errors (in other words, display_errors = 0) but don't suppress them. But, sometimes while doing quick testing, or as MadTechie said, personal code, it can be fine. Quote Link to comment https://forums.phpfreaks.com/topic/180201-solved-do-i-have-to-use-before-mysql_connect-and-other-fuctions-inside-class/#findComment-950613 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.