I am trying to insert data into mysql table using python:
add_user = ("INSERT INTO users_new "
"(first_name, last_name, hire_date, gender, birth_date) "
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s)")
data_user = ('Ali', 'Ahmed', tomorrow, 'M', date(1977, 6, 14))
cursor.execute(add_user, data_user)
but I have the following error:
cursor.execute(add_user, data_user) File "C:\Python27\lib\site-packages\mysql\connector\cursor.py", line 555, in execute stmt = RE_PY_PARAM.sub(psub, stmt) File "C:\Python27\lib\site-packages\mysql\connector\cursor.py", line 86, in call "Not enough parameters for the SQL statement") ProgrammingError: Not enough parameters for the SQL statement