Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59

This commit is contained in:
sietse jonker
2024-03-30 22:57:45 +01:00
2 changed files with 4 additions and 4 deletions

View File

@@ -69,12 +69,12 @@ def getNodeInfo(macAdress):
return result
def getQuestionData():
def getQuestionData(questionID, replies):
mydb = loginDB()
query = get_query(False, False, False, True, False)
query = get_query(False, False, False, questionID, replies)
cursor = mydb.cursor(dictionary=True) # Enable dictionary output
cursor.execute(query)
result = cursor.fetchall() # Fetch the results
result = cursor.fetchall() # Fetch the results
cursor.close()
mydb.close()

View File

@@ -8,7 +8,7 @@ def get_query(node, dataType, MAC, questionID, replies):
elif MAC:
query = f"SELECT * FROM Node WHERE MAC = '{MAC}'"
elif replies and questionID:
query = f"SELECT * FROM Reply WHERE QuestionID = '{questionID}'"
query = f"SELECT * FROM Reply WHERE replies = '{replies}' AND QuestionID = '{questionID}'"
elif questionID:
query = f"SELECT * FROM Question"
elif replies: