i'm trying to fuse 2 MySQL tables in 1. Both tables have a column with the same values, so i would actually do a join. I'll show you the code i'm using to do that:
import MySQLdb
import _mysql
mobility = MySQLdb.connect(host="127.0.0.1", user="root", passwd="", db="Mobility")
mobility_cursor = mobility.cursor()
datasets = _mysql.connect(host='127.0.0.1',user='root',passwd='',db='datasets')
datasets.query("SELECT * FROM process_manager_Temp1")
proc_man_Temp1 = datasets.store_result()
proc_man_Temp1_dicts = proc_man_Temp1.fetch_row(maxrows=0, how=1)
for row in proc_man_Temp1_dicts:
mobility_cursor.execute("UPDATE `process_manager_Temp` SET(`Resource`, `Format`) VALUES (%s,%s) WHERE `process`=%s ", (row['Resource'],row['format'],row['process'])
mobility.commit()
It gives me an error on the last line. It says
siimobility.commit() SyntaxError: invalid syntax
Antbody know what's wrong ? Oe may be there's a quicker way to do this.