I got an syntax error in this code:
msql=("SELECT FILE_NAME FROM file_processed WHERE FILE_NAME = %s ;")
if cursor.execute(msql,name):
return True
else:
return False
i got an error near '%s' can anybody tell me wherE? thanks!
error: mysql.connector.errors.ProgrammingError: 1064(42000): You have an error in SQL syntax: check Mysql server version for the right syntax to use near '%s' at line 1 Im using mysql 5.6
Now I try this:
msql=("SELECT FILE_NAME FROM file_processed WHERE FILE_NAME='HCTC3153_INF.TXT'; ")
if cursor.execute(msql):
print "its is in the db"
return True
else:
print "its not in db"
return False
Always return its not in db even is in there... The error raise now is: raise errors.InternalError("Unread result found.") mysql.connector.errors.InternalError: Unread result found.