السلام عليكم
في دورة الاستاذ محمد عيسى للبايثون واجهتني مشكلة في الدرس 120 عندما اقوم بكتابة الكود الذي قام بكتابته لا يريد ان يقوم بالكتابة في الmysql
هذا هو الكود :
import MySQLdb
db = MySQLdb.connect("localhost","mahmod","123","mahmod")
cursor = db.cursor()
sql = """INSERT INTO EMPLOYEE(FIRST_NAME,
LAST_NAME, AGE, SEX, INCOME)
VALUES ('MAHMOD', 'ABDALKAREEM', 22, 'M', 2000)"""
try:
cursor.execute(sql)
db.commit()
except:
db.rollback()
db.close()
ونفس الامر يحدث في الدرس الذي يليه
ما هي المشكلة؟؟؟
لقد تأكد منه وعندما قمت بتنفيذ الكود هذا ما ظهر
line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'"INSERT INTO EMPLOYEE(FRIST_NAME,\n LAST_NAME, AGE, SEX, INCOME)\n \' at line 1')
التعليقات