From 8b547bd78621efb32c783df5a285a5394e1be4b9 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 18 Mar 2022 09:29:41 +0100 Subject: [PATCH] #3 --- database.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/database.py b/database.py index cc3ada6..574d536 100644 --- a/database.py +++ b/database.py @@ -1,20 +1,20 @@ # TODO: Datenbank Klasse (CRUD) -import mysqlx +import mysql.connector -def create_database(db_cursor): - # TODO Datenbank erstellen - return - - -def create_table(db_cursor, database_name): +def create_database(db_cursor, database_name): query = f'CREATE DATABASE {database_name}' try: db_cursor.execute(query) - except mysqlx.Error as err: + except mysql.connector.Error as err: print('Something went wrong', err) +def create_table(db_cursor): + # TODO Frage / Antwort Tabellen erstellen + return + + def add(db_cursor): # TODO Frage / Antwort hinzufügen return