Commit d5776159 authored by Ismail Moumni's avatar Ismail Moumni
Browse files

editing database

parent 18d01e9a
......@@ -115,7 +115,7 @@ def get_generators():
generators[result[0]] = [result]
# Insert in database a query send from client and returns insert status
# Insert in database query send from client and returns insert status
def db_insert(query: dict):
if(query is not None):
database = database_connection()
......@@ -125,7 +125,6 @@ def db_insert(query: dict):
values = query.values()
cols = query.keys()
sql_new_job_row = "INSERT INTO jobs (%s) VALUES ('%s');" % (", ".join(cols), "','".join(values))
print(sql_new_job_row)
mycursor = database.cursor(buffered=True)
mycursor.execute(sql_new_job_row)
print("Record inserteds in DB :", query.values)
......@@ -135,6 +134,7 @@ def db_insert(query: dict):
print("MYSQL Error :{}".format(err))
# Checks existance of query ID in database and returns the status
def db_job_check(query: dict):
if (query is not None):
db = database_connection()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment