运行环境:window Xp python 2.7 Mysql 5.5
代码如下:
import MySQLdb
import random
def InsertFun():
Conn = MySQLdb.connect(host='localhost',user='dpai',passwd='ep',db='ep',port=7880,charset='utf8')
cursor=Conn.cursor()
#execute the sql
InsetValue="""INSERT INTO `base_member_info`
(MEMBER_NAME,MEMBER_LOGIN_NAME,MEMBER_LOGIN_PW,PW_STRENGTH,MEMBER_MOBILE,VERIFI_CODE,MOBILE_BINDING_STATUS,MEMBER_PHONE,
MEMBER_FAX,MEMBER_EMAIL,IDCARD_TYPE_ID,MEMBER_IDCARD,MEMBER_BANKCARD_STATUS,MEMBER_CITY,MEMBER_STREET,MEMBER_ZIPCODE,MEMBER_CREAT_TIME,
MEMBER_LAST_LOGIN,MEMBER_LOG_TIMES,MEMBER_STATE)
VALUES ('Hn1','hn102@epai.hk','c4ca423eaa17c3820dcc509a6f75849b','2','15611242813','817171','1','+86-010-','+86-010-','he_2@epai.hk','2','6535445842556','0','5','china','100027','2013-11-11 10:29:44','2013-11-11 14:53:06',
'0','1');"""
cursor.execute(InsetValue)
Conn.commit
InsertFun()
改为Conn.commit()虽然没有高过这个,但是我知道commit明显是个动作。嘿嘿。。-》-》<divclass="ref">
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。