Is there a way to create 'sub-tables'? It's been a while since I've using any SQL, and the one I did use was MySQL.
What I'm trying to do is create a sub-table of 'shops' to store item data.
PHP Code:
sql.execute(
"CREATE TABLE IF NOT EXISTS shops ("
@ "title TEXT NOT NULL DEFAULT 'Shop', "
@ "stype TEXT NOT NULL DEFAULT 'Server', "
@ "owner TEXT NOT NULL DEFAULT 'Unknown', "
@ "kerou INT NOT NULL DEFAULT 5000, "
@ "desc TEXT NOT NULL DEFAULT 'Description text.', "
@ "createtime INT NOT NULL DEFAULT CURRENT_TIMESTAMP)", false);
sql.execute (
"CREATE TABLE IF NOT EXISTS shops.items ("
@ "arch TEXT NOT NULL DEFAULT 'Unknown', "
@ "price INT DEFAULT 0, "
@ "stock INT DEFAULT 0)", false);
However, I get the following error:
Quote:
SQL Error: unknown database shops
Query: CREATE TABLE IF NOT EXISTS shops.items (arch TEXT NOT NULL DEFAULT 'Unknown', price INT DEFAULT 0, stock INT DEFAULT 0)
|