Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
First, you will have the mysql.connector
. If you’re not sure of the way to get this setup, seek advice from Find out 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 clients SET tackle = 'Stoneleigh Place' WHERE tackle = 'Abbey Street'"
mycursor.execute(sql)
mydb.commit()
print(mycursor.rowcount, "document(s) affected")
import mysql.connector
mydb = mysql.connector.join(
host = "localhost",
consumer = "username",
password = "YoUrPaSsWoRd",
database = "your_database"
)
mycursor = mydb.cursor()
sql = "UPDATE clients SET tackle = %s WHERE tackle = %s"
val = ("Stoneleigh Place", "Abbey Street")
mycursor.execute(sql, val)
mydb.commit()
print(mycursor.rowcount, "document(s) affected")