From ff3501e57211a968e0752a738e8359b89eb86d57 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2016 18:01:45 +0200 Subject: [PATCH] Try to insert packet into database --- web-to-db.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web-to-db.py b/web-to-db.py index 902e5b0..d6782d2 100644 --- a/web-to-db.py +++ b/web-to-db.py @@ -37,6 +37,9 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler): def insert_xml(self, data): try: conn = psycopg2.connect("dbname=hackzurich") + cursor = conn.cursor() + cursor.execute("insert into data_test4 (packet) values ('%s')" % data) + conn.close() except Exception as e: print("DB Insert failed: %s" % e)