What are the different functions of these two SQL statements?
2 sentences in PHP file
@mysql_query ("UPDATE users SET s_abc=0 WHERE us= ' Kuku '");
mysql_query ("UPDATE users SET s_abc=0 WHERE us= ' Kuku '");
Just one more @, can you tell me what's the difference? Puzzled
------Solution--------------------
With @, if the mysql_query execution exception throws an error message, it will be masked and not displayed.
------Solution--------------------
@ Do not display error messages
The error suppression character. Mysql_query if he has an error, he will block it, and it will not show any errors.
I do not add in the development project, there are generally error-handling base class.
------Solution--------------------
@ ERROR control, masking error message.
It is generally not in the code, and it is best to write it when executing sql:
PHP code
$sql = "SELECT * from table where dqs= ' {$DQS} '"; $res = Mys Ql_query ($sql); if (! $res) die ("sql:{$sql}
Error:". Mysql_error ()); if (mysql_affected_rows () > 0) {$arr = array (); while ($rows = Mysql_fetch_array (MYSQL_ASSOC)) {Array_push ($arr, $rows); }}else{echo "Query failed
Error:". Mysql_error ();}
------Solution--------------------
@ is a masking error message
Recommendation: Do not use when testing, this is useful to check for errors and find problems,
If the project is put into use, it is recommended to add this, so that the error message appears The
does not affect the user's use!