on windows not add record??
MySQL database connector for Python programming
Brought to you by:
adustman
This script running and printing
Number of rows inserted 4
but its not adding dbase?
And if I ading record in commanline mysql > its reading to python ?
Shortly its reading but not writing?
import MySQLdb
conn=MySQLdb.connect(host="localhost",user="root",passwd="xxxxx",db="emlak")
cursor = conn.cursor ()
cursor.execute ("DROP TABLE IF EXISTS animal")
cursor.execute ("""
CREATE TABLE animal
(
name CHAR(40),
category CHAR(40)
)
""")
cursor.execute ('''
INSERT INTO animal (name, category)
VALUES
('snake', 'reptile'),
('frog', 'amphibian'),
('tuna', 'fish'),
('racoon', 'mammal')
''')
print "Number of rows inserted: %d" % cursor.rowcount
Try committing a transaction