Re: [Tutor] MySQL api does not accept variable.

2006-01-06 Thread Alan Gauld
> I can't think of the con's and the pro's of keeping open > the mysql connection when the script starts and close > it when it ends.. The reasoning is that you want to open the connection at the start of a script do all your processing then close it. In between you might want to add data, cre

Re: [Tutor] MySQL api does not accept variable.

2006-01-06 Thread Panagiotis Atmatzidis
Hello, Thank you for the reply. You can browse the entire script code[1]. The truth is that I did not think about it. The speed is acceptable for me, but as you point you out, it does not make much sense. I can't think of the con's and the pro's of keeping open the mysql connection when the script

Re: [Tutor] MySQL api does not accept variable.

2006-01-06 Thread Alan Gauld
def sql_listusers(hostname, dbusername, dbpassword, dbbase, dbasename): try: conn = MySQLdb.connect (host = hostname, user = dbusername, passwd = dbpassword, db = dbbase) cursor = conn.cursor () cursor.execute

[Tutor] MySQL api does not accept variable.

2006-01-06 Thread Panagiotis Atmatzidis
Hello, This is a snip of my code: def sql_listusers(hostname, dbusername, dbpassword, dbbase, dbasename): try: conn = MySQLdb.connect (host = hostname, user = dbusername, passwd = dbpassword, db = dbbase) cursor