Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import MySQLdb
- server = "sql6.freemysqlhosting.net"
- dbport="3306"
- dbuser="sql61425"
- password="pass"
- dbname="sql61425"
- voltage = "206"
- try:
- db= MySQLdb.connect(host=server,port=dbport,user=dbuser,passwd=password,db=dbname)
- cursor=db.cursor()
- sql="UPDATE pump SET voltage='%s'"%(voltage)
- try:
- cursor.execute(sql)
- db.commit()
- db.close()
- print voltage
- except:
- print "Could not update date "
- db.close()
- except:
- print " Could not connect cloud server database...."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement