init #2
This commit is contained in:
parent
4ae2368f80
commit
5678c31efb
|
@ -1 +1,12 @@
|
|||
# TODO Database verbindung herstellen
|
||||
|
||||
import mysql.connector
|
||||
|
||||
def db_connection(user, password, host):
|
||||
connection = None
|
||||
|
||||
try:
|
||||
connection = mysql.connector.connect(user, password, host)
|
||||
except mysql.connector.Error as err:
|
||||
print('Something went wrong' , err)
|
||||
return connection.cursor()
|
||||
|
|
15
datenbank.py
15
datenbank.py
|
@ -1,30 +1,33 @@
|
|||
# TODO: Datenbank Klasse (CRUD)
|
||||
|
||||
def create_database():
|
||||
import database_connection
|
||||
|
||||
|
||||
def create_database(db_cursor):
|
||||
# TODO Datenbank erstellen
|
||||
return
|
||||
|
||||
|
||||
def create_table():
|
||||
def create_table(db_cursor):
|
||||
# TODO Table erstellen
|
||||
return
|
||||
|
||||
|
||||
def add():
|
||||
def add(db_cursor):
|
||||
# TODO Frage / Antwort hinzufügen
|
||||
return
|
||||
|
||||
|
||||
def read_question():
|
||||
def read_question(db_cursor):
|
||||
# TODO Frage / Antwort auslesen
|
||||
return
|
||||
|
||||
|
||||
def update_question():
|
||||
def update_question(db_cursor):
|
||||
# TODO Frage / Antwort Aktualisieren
|
||||
return
|
||||
|
||||
|
||||
def del_question():
|
||||
def del_question(db_cursor):
|
||||
# TODO Frage / Antworte löschen
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user