Basic phpmysql to prevent SQL attack injection. We used MagicQuotes in the php Tutorial to determine whether it was enabled, if the strips tutorial is lashes, otherwise, use the mysql tutorial _ real_escape_string to filter out. if the MagicQuotes function is used, we use the Magic Quotes provided by the php Tutorial to determine whether it is enabled, if the strips tutorial is lashes, use mysql tutorial _ real_escape_string for filtering.
// If Magic Quotes is enabled
If (get_magic_quotes_gpc ()){
$ Name = stripslashes ($ name );
} Else {
$ Name = mysql_real_escape_string ($ name );
}
Mysql_query ("SELECT * FROM users WHERE name = '{$ name }'");
Note: The mysql_real_escape_string function is valid only when the mysql database connection is successful.
Define Quotes to determine whether it is enabled. if it is, use the strips tutorial lashes; otherwise, use the mysql tutorial _ real_escape_string to filter out. // If Magic Quotes is used...