cursor.execute(sql1)
conn.commit()
effectRow = cursor.rowcount
print(effectRow)
If it's the same, then zero.
Otherwise, none zero.
Belows are from: https://blog.csdn.net/ghostyusheng/article/details/77836056
-- MySQL 更新或插入后获取受影响行数
SELECT ROW_COUNT();
-- mysql 插入一条记录后获取插入记录的主键id
SELECT LAST_INSERT_ID();