May-19-2022, 11:34 PM
I tried adding WHERE type = table to my SELECT statement to be more specific but I get the same error.
My table is populated so I don't know what you mean by
Here's the table (called items) that was created:
My table is populated so I don't know what you mean by
Quote:Your database has no table items.could you please clarify what you mean by that?
Here's the table (called items) that was created:
import sqlite3 def createDatabase(): #Create a database (inventory.db) connection = sqlite3.connect("inventory.db") cursor = connection.cursor() table = """CREATE TABLE IF NOT EXISTS items (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL, Quantity INT NOT NULL, Price DOUBLE NOT NULL, Sell_Price DOUBLE, Description TEXT, Category TEXT, Location TEXT NOT NULL, Length_Ft INT, Barcode INT, Image BLOB, Date Updated datetime default current_timestamp);""" #Execute the creation of the table cursor.execute(table) #print("The database has been created") #Commit the changes connection.commit() #Close the connection connection.close()