What are the different functions of these two SQL statements? 2 @ mysql_query (& quot; UPDATEusersSETs_abc0WHEREuskuku & quot;); mysql_query (& quot; UPDATEusersSETs_abc0WHEREuskuku & quot;) in the PHP file is an additional @ number, is there any difference between these two SQL statements?
2 sentences in the PHP file
@ Mysql_query ("UPDATE users SET s_abc = 0 WHERE us = 'kuku '");
Mysql_query ("UPDATE users SET s_abc = 0 WHERE us = 'kuku '");
There is one more @ Number. Is there any difference between them? Puzzled
------ Solution --------------------
[Email protected]. If an error message is thrown during execution of mysql_query, it is blocked and not displayed.
------ Solution --------------------
@ Error message not displayed
Error blocker. If an error occurs in mysql_query, @ will block it and no error will be displayed.
I do not add a base class for error handling in development projects.
------ Solution --------------------
@ Error control operator, blocking error messages.
Generally, @ is not added to the code. it is best to write the SQL statement as follows:
PHP code
$ SQL = "select * from table where dqs = '{$ dqs}'"; $ res = mysql_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 --------------------
@ Shield error message
Suggestion: do not use it during testing. this helps check errors and discover problems,
If the project is put into use, we recommend that you add this so that the error message appears.
This will not affect your use!