Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
First, you will want the mysql.connector
. In case you are not sure of the best way to get this setup, discuss with Learn how to Set up MySQL Driver in Python.
import mysql.connector
mydb = mysql.connector.join(
host = "localhost",
consumer = "username",
password = "YoUrPaSsWoRd",
database = "your_database"
)
mycursor = mydb.cursor()
sql = "UPDATE prospects SET deal with = 'Stoneleigh Place' WHERE deal with = 'Abbey Highway'"
mycursor.execute(sql)
mydb.commit()
print(mycursor.rowcount, "file(s) affected")
import mysql.connector
mydb = mysql.connector.join(
host = "localhost",
consumer = "username",
password = "YoUrPaSsWoRd",
database = "your_database"
)
mycursor = mydb.cursor()
sql = "UPDATE prospects SET deal with = %s WHERE deal with = %s"
val = ("Stoneleigh Place", "Abbey Highway")
mycursor.execute(sql, val)
mydb.commit()
print(mycursor.rowcount, "file(s) affected")