I am recieving errors like this one:
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't Stop.mp3' LIMIT 1' at line 1")
Because I am trying to compare a URL that exists in my DB to one in a variable before I choose to insert it or not with the below code:
`#see if any links in the DB match the crawled link
check_exists_sql = "SELECT * FROM LINKS WHERE link = '%s' LIMIT 1" % item['link'].encode("utf-8")
cursor.execute(check_exists_sql)`
Obviously the '
character and perhaps other characters are causing problems.
How do I format these URLs to avoid this?