首页 > 代码库 > Python中MySQL插入数据

Python中MySQL插入数据

1 sql = INSERT INTO course(class_name, credit, properties, teacher_name, college_given, classroom)  2                   VALUES ("%s", "%d", "%s", "%s", "%s", "%s") % 3                   (class_name, credit, properties, teacher_name, college_given, classroom)
4             cursor.execute(sql)
5             conn.commit()

 

Python中MySQL插入数据