modpydb.py fortsättning.. def run_sql(sql, param=None, n=0, with_desc=0): """ Runs SQL on the server and returns result """ db = _db_login() if param: param = tuple(param) try: cur = db.cursor() rc = cur.execute(sql, param) except: # it's possible that mysql connection # timed out. Try one more time. db = _db_login(relogin = 1) cur = db.cursor() rc = cur.execute(sql, param)