Go to Python MySQL escape

Source: Internet
Author: User
Tags python mysql

Recently using Python to do the project with MySQL, some python crawl some of the data into MySQL, but there is a problem, because the data crawled from the outside with ' other irregular data, if you directly call the method of inserting data will prompt an error, this time need to use
python MySQL escaped .

I began to think that MySQLdb did not have a built-in method, originally intended to go to a filtering algorithm, and then think of MySQL This module should itself will take some escape method, so with this belief constantly find, through the Help method and the method of Dir finally found, originally is: Escape_ String

If you want to use MySQL to escape the string, then you can look at the following methods:
Content = mysqldb.escape_string (content)

Very little knowledge, hope that you need to use the time to play a due help, thank you for your support!

Go to Python MySQL escape

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.