Add registration

This commit is contained in:
David Hoppenbrouwers
2022-10-08 15:25:28 +02:00
parent 671f1c2ec6
commit e9ef9140f0
8 changed files with 105 additions and 8 deletions

View File

@@ -283,5 +283,19 @@ class DB:
return True
return False
def add_user(self, username, password, time):
db = self._db()
c = db.cursor()
c.execute('''
insert into users(name, password, join_time)
values (?, ?, ?)
''',
(username, password, time)
)
if c.rowcount > 0:
db.commit()
return True
return False
def _db(self):
return sqlite3.connect(self.conn)