This repository has been archived on 2024-10-20. You can view files and clone it, but cannot push or open issues or pull requests.
burgercat/newchatroom

18 lines
415 B
Plaintext
Raw Permalink Normal View History

2023-07-11 20:41:57 +01:00
#!/usr/bin/python3
import sqlite3
import time
import os
chatroomname = input("Insert name: ")
def get_db_connection():
conn = sqlite3.connect("database.db")
conn.row_factory = sqlite3.Row
return conn
conn = get_db_connection()
conn.execute("INSERT INTO chatrooms (roomname, creator, created) VALUES (?, ?, ?)",
(chatroomname, 1, str(time.time())))
conn.commit()
conn.close()
print("Success!")