In looking at various mysql and php code, I've seen the database connection written either with an ampersand or without:
$db = mysqli_connect (db_host, db_user, db_pw, db_name);
vs
$db = @mysqli_connect (db_host, db_user, db_pw, db_name);
Is there are reason some developers use the @ and others do not?
Thank you
@
is the error suppression operator and hides warnings / errors that the function outputs. Using it is generally considered as bad practice.
While developing, the error messages are there for a reason. If you don't want to display the error messages, turn off error reporting in your php.ini
configuration and log them instead.