If you want to insert Python values into a SQL database, just naming the Python variables in the SQL statement is not enough. The SQL database instead thinks you wanted to insert values taken from the table or another query instead.
Use SQL parameters instead, and pass in the actual values:
params = (userName, password, confirmPassword, firstName, lastName,
companyName, email, phoneNumber, addressLine1, addressLine2,
addressLine3, zipCode, province, country, regDate)
c.execute("INSERT INTO People VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", params)
The NULL value is for the p_ID primary key column; the alternative is to name all the columns you want to insert values for.
https://www.e-learn.cn/topic/482719
Read More:
- django.db.utils.OperationalError: no such table: django_admin_log
- Error no module named ‘in newly installed Python_ sqlite3‘
- Word column after the text evenly distributed in the left and right two columns, rather than fill in the left column and then fill in the right column, how to do?
- In the SQL query statement, add the column that does not exist in the table and set the fixed value of the column
- psycopg2.OperationalError: SSL SYSCALL error: EOF detected
- android.database.sqlite.SQLiteException: near “where”: syntax error (code 1): ,
- python sqlite Error IntegrityError: UNIQUE constraint failed: table_area1.user_name
- yum install/update error: sqlite3.DatabaseError: database disk image is malformed
- configure: error: Package requirements (sqlite3 」 3.7.4) were not met:
- entity framework core + SQLite Error 1: ‘no such table: Blogs’.
- In SQLite database, set the default value for the field as the current time
- Unknown error (SQLite code 14): could not open database (How to Fix)
- Pandas get column name
- C programming interface of SQLite database (6) result codes and error codes
- java.lang.IllegalArgumentException: column ‘_id’ does not exist
- Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column xxxx
- R note for Bioinfo: the column for the select call is undefined
- Permission denied error: unable to index file .vs/Trip2015/v15/Server/sqlite3/db.lock fatal: adding
- ERROR 1048 (23000): Column ‘courseno‘ cannot be null
- Error 1136 (21s01): column count doesn’t match value count at row 1