While loop
Posted by:
João Abrantes ()
Date: September 16, 2008 08:50AM
hello everyone.
i have a program that is in a while loop using the select command to read a table from sql.
conn = MySQLdb.Connect(host='localhost', user='root', db='database', passwd='password')
curs = conn.cursor()
while 1:
curs.execute('select * from table')
print curs.fetchall()
And i have another program that inserts rows on the table.
The thing is that the program that reads the table won't read the updated information.. he just keeps reading what he had read when it started. But if I make a connection to the database before each read to the table the program will show updated information..:
while 1:
conn = MySQLdb.Connect(host='localhost', user='root', db='database', passwd='password')
curs = conn.cursor()
curs.execute('select * from table')
print curs.fetchall()
ins't there any other way to do this? thanks
Sorry, you can't reply to this topic. It has been closed.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.