aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xanalyse/insertpaq.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/analyse/insertpaq.py b/analyse/insertpaq.py
index 1e9a397..60d4796 100755
--- a/analyse/insertpaq.py
+++ b/analyse/insertpaq.py
@@ -109,12 +109,17 @@ def connexionBD():
conn=connexionBD()
cur=conn.cursor()
-sql="""
-insert into paquet(heure,protocole,ip_source,ip_destination,port_source,port_destination) values ('{}','{}','{}','{}','{}','{}');
-insert into paquet(heure,protocole,ip_source,ip_destination,port_source,port_destination) values ('{}','{}','{}','{}','{}','{}');
-""".format(a,b,c,e,d,f,z,y,x,v,w,u)
+#sql="""
+#insert into paquet(heure,protocole,ip_source,ip_destination,port_source,port_destination) values ('{}','{}','{}','{}','{}','{}');
+#insert into paquet(heure,protocole,ip_source,ip_destination,port_source,port_destination) values ('{}','{}','{}','{}','{}','{}');
+#""".format(a,b,c,e,d,f,z,y,x,v,w,u)
-cur.execute(sql)
-conn.commit()
+cur.execute("INSERT INTO paquet (heure,protocole,ip_source,ip_destination,port_source,port_destination) VALUES (%s, %s, %s, %s, %s, %s)",
+ (a, b, c, e, d, f))
+cur.execute("INSERT INTO paquet (heure,protocole,ip_source,ip_destination,port_source,port_destination) VALUES (%s, %s, %s, %s, %s, %s)",
+ (z, y, x, v, w, u))
+
+#cur.execute(sql)
+conn.commit()
conn.close()