以下是代码:
MarketID = data['Markets'][x]['ID'] # Get from JSON data
cursor = db.cursor()
cursor.execute("SELECT COUNT(*) FROM markets WHERE ID = %s", (MarketID,))
rowCount = cursor.rowcount
print('Rowcount:', rowCount)
问题?返回的行数为1.它应该为0.此时,数据库为空。所有表格都是无人居住的。那么我怎么得到1?