From b61ae873f1bbecfd0af9c95449cef563ad2e4772 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 10 Feb 2017 16:42:35 +0100 Subject: [PATCH] Forgot to change back the adr of UPDATE sql function to be dynamic to content of online, not a static value. Also removed conn.commit for function where only selects, not update or add. --- macLookup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macLookup.py b/macLookup.py index 01c4609..620b895 100755 --- a/macLookup.py +++ b/macLookup.py @@ -34,7 +34,6 @@ def getTimes(): for name, time in c.fetchall(): returnList.append({"name": name, "time": convertTime(time)}) - conn.commit() conn.close() return returnList @@ -66,7 +65,7 @@ def updateTimes(): online = list(set(getOnlineClients()) & set(getAddr(c))) for adr in online: - c.execute('UPDATE lastonline SET timesince='+ str(curTime) +' WHERE clientadr="cc:29:f5:b8:2d:a2"') + c.execute('UPDATE lastonline SET timesince='+ str(curTime) +' WHERE clientadr="'+ adr + '"') conn.commit() conn.close()