This commit is contained in:
parent
8b547bd786
commit
b80adf49e1
17
database.py
17
database.py
|
@ -2,34 +2,29 @@
|
|||
import mysql.connector
|
||||
|
||||
|
||||
def create_database(db_cursor, database_name):
|
||||
query = f'CREATE DATABASE {database_name}'
|
||||
def create(db_cursor, name):
|
||||
query = f'CREATE DATABASE {name}'
|
||||
try:
|
||||
db_cursor.execute(query)
|
||||
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
|
||||
|
||||
|
||||
def read_question(db_cursor):
|
||||
def read(db_cursor):
|
||||
# TODO Frage / Antwort auslesen
|
||||
return
|
||||
|
||||
|
||||
def update_question(db_cursor):
|
||||
def update(db_cursor):
|
||||
# TODO Frage / Antwort Aktualisieren
|
||||
return
|
||||
|
||||
|
||||
def del_question(db_cursor):
|
||||
# TODO Frage / Antworte löschen
|
||||
def del_(db_cursor):
|
||||
# TODO Frage / Antwort löschen
|
||||
return
|
||||
|
|
2
main.py
2
main.py
|
@ -25,7 +25,7 @@ def menu():
|
|||
case 1:
|
||||
print('#Datenbank erstellen#') # Platzhalter für die Funktion
|
||||
database_name = input('Wie soll die Datenbank heißen?')
|
||||
database.create_database(cursor)
|
||||
database.create(cursor,database_name)
|
||||
case 2:
|
||||
print('Datenbank löschen') # Platzhalter für die Funktion
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue
Block a user