Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update create_db.py #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions cgi-bin/create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@

def create_db():
assert not os.path.exists(DB_FILE)
#connecting to database
(con, cur) = db_connect()
# SQL Query for creating table
cur.execute('''CREATE TABLE query_log
(id INTEGER PRIMARY KEY,
post_date TEXT,
ip_addr TEXT,
user_agent TEXT,
input_script TEXT,
post_date TEXT NOT NULL,
ip_addr TEXT NOT NULL,
user_agent TEXT NOT NULL,
input_script TEXT NOT NULL,
had_error INTEGER)''')
#Execute query
con.commit()
#close database connection
cur.close()

if __name__ == "__main__":
Expand Down