A further understanding of SQL injection

Source: Internet
Author: User

As a regular customer dealing with the database, will certainly involve the problem of SQL injection, before I briefly introduced this aspect of the problem, then the feeling is that if you do not make some restrictions on the input data, then your database is very dangerous, the small data is broken, the big system ran, Serious words if it is a big information or financial system will have unthinkable consequences, these days in the press release system, the teacher personally showed us the effect of SQL injection, but also let oneself have a deeper understanding of SQL injection, the following share their own SQL injection of re-understanding!

SQL injection is the fixed structure of SQL statements that try to get some field information in the database, which can result in unpredictable results. For example, our text box is a function to implement query information, then its SQL statement is select information from where * * *, then we enter the content corresponding to information, once we enter in the text box "') Delete * * ", then the real SQL statement in the database is select information ') Delete * * * FROM WHERE * * *.

The effect is as follows:


So the system will think of this as two SQL statements, which will result in the loss of information in the database, it can be said that this is a SQL Structured query statement of the drawbacks, so in order to avoid such problems, there is a study of SQL injection problem.

In order to avoid such problems, we often use the method of inserting parameters to solve, that is, there is no real or similar to the database field names exist, we pass in the system are parameters, which greatly reduces the risk of database corruption, but to maintain the security of the database is a comprehensive, grand topic, I also need more study and understanding, look forward to everyone's enlighten!



A further understanding of SQL injection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.