wrote:
> On 10鏈17鏃, 涓嬪崍6鏃41鍒, Peter Otten <__pete...@web.de> wrote:
>> gdy...@gmail.com wrote:
>> > the code is below:
>> > import pymssql
>> > conn = pymssql.connect(host = "121.198.126.233",user = "xxxx",password
>> > = "xxxx",database = "test")
>> > print "connecting success"
>> > cursor = conn.cursor()
>> > cursor.execute("insert into bbs_test values(%s,%s,%s,%s,%s)",
>> > ("1","nju","9:13","ustc","test"))
>> > cursor.close()
conn.commit() # This makes the inserted record permanent
>> > conn.close()
>> > in the idle:
>> > connecting success
>>
>> > then i get into the database :test and find that there is nothing in
>> > the table bbs_test.
>> > i don't know why
>>
>> Because you did not commit your changes with conn.commit().
> ???how to.
Call conn.commit() before conn.close() like shown above.
Peter