Answer the question
In order to leave comments, you need to log in
Sqlite Python.Error what to do?
import sqlite3
conn = sqlite3.connect("mydatabase.db")
cursor = conn.cursor()
CREATE TABLE login (
id INT (11) NOT NULL,
user_name TEXT (256) NOT NULL);
File "db.py", line 4
CREATE TABLE login (
^
SyntaxError: invalid syntax
Answer the question
In order to leave comments, you need to log in
Sorry, but this is already some kind of p ... c. You would at least look through the simplest reference book chtoli.
import sqlite3
conn = sqlite3.connect("mydatabase.db")
cursor = conn.cursor()
cursor.execute('CREATE TABLE login (id INT (11) NOT NULL,user_name TEXT (256) NOT NULL)')
Learn more Python. Your current level is not enough to write a program.
This error can be thrown if the database has ALREADY been created.
And you are trying to create the same database with the same name.
In this case, you need to connect to the database,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question