Guest User

Untitled

a guest
May 13th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. event=getxml() //table 1- XML
  2. description = event.getname('921')
  3. xmlvalue = jsonify (description)
  4. conn=pymysql.connect(host='',user='',password='',db='') // table 2 - MYSQL
  5. a=conn.cursor()
  6. sql='SELECT logseq, logcode FROM `table2`Where Event_code = 921 '
  7. a.execute(sql)
  8. row_headers=[x[0] for x in a.description]
  9. data = a.fetchall()
  10. json_data=[]
  11. for result in data:
  12. json_data.append(dict(zip(row_headers,result)))
  13. jsonvalue = json.dumps(json_data)
  14. return (jsonvalue,xmlvalue)
  15.  
  16. TypeError('Invalid status argument',)
Add Comment
Please, Sign In to add comment