This commit is contained in:
marcus 2022-03-17 13:36:16 +01:00
parent 5678c31efb
commit bc6134fdbb
3 changed files with 9 additions and 4 deletions

View File

@ -2,11 +2,12 @@
import mysql.connector import mysql.connector
def db_connection(user, password, host): def db_connection(user, password, host):
connection = None connection = ''
try: try:
connection = mysql.connector.connect(user, password, host) connection = mysql.connector.connect(user=user, password=password, host=host)
except mysql.connector.Error as err: except mysql.connector.Error as err:
print('Something went wrong' , err) print('Something went wrong', err)
return connection.cursor() return connection.cursor()

View File

@ -5,6 +5,7 @@
import config import config
import database_connection import database_connection
def menue(): def menue():
# TODO Menü erstellen # TODO Menü erstellen
return return
@ -12,3 +13,6 @@ def menue():
def main(): def main():
database_connection.db_connection(config.user, config.password, config.host) database_connection.db_connection(config.user, config.password, config.host)
main()

0
questions_awnsers.json Normal file
View File