What will the following code do?
import mysql.connector
db = mysql.connector.connect(...)
cursor = db.cursor()
sali = "update category set name = "% WHERE ID=%"% ('CSS,2)
cursor.execute(sqli)
db.commit()
print ("Rows affected", cursor.rowcount)
db.close()
Attachments:
Answers
Answered by
1
- It will open a database connection to a database.
- Creates a statement to update category name to CSS where is is 2
- It executes this statement & commits it permanently.
- It prints the number of affected rows which in this case is 1
- Then closes the correction to the database.
Answered by
5
Answer:
really do you love me mate
Similar questions
English,
2 months ago
English,
2 months ago
Math,
4 months ago
World Languages,
4 months ago
Computer Science,
9 months ago
Hindi,
9 months ago
Hindi,
9 months ago