Thread: SQLite
View Single Post
  #34  
Old 04-12-2009, 06:31 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
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)
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote