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