In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to clean client data with mysql_real_escape_string on the server side". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to clean client data with mysql_real_escape_string on the server side.
Because mysql_real_escape_string requires a MySQL database connection, you must connect to the MySQL database before calling mysql_real_escape_string.
PHP:
Call method
PHP:
The cleaned data can be inserted directly.
Be careful! _ real_escape_string must be used (PHP 4 > = 4.3.0, PHP 5). Otherwise, you can only use mysql_escape_string. The difference between the two is:
Mysql_real_escape_string takes into account the current character set of the connection, while mysql_escape_string does not.
Because mysql_real_escape_string requires a MySQL database connection, you must connect to the MySQL database before calling mysql_real_escape_string.
When we know that the data type is a string, we can limit the string length while cleaning the data. This method comes from David Lane, Hugh E. Williams "Web Database Application with PHP and MySQL" (OReilly, May 2004)
PHP:
Call method:
PHP:
Clean the username in the $_ POST array and truncate the first 20 characters.
At this point, I believe you have a deeper understanding of "how to clean client data with mysql_real_escape_string on the server side". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.