(query, parameters=None)
Generic fetch query.  Returns a list of all results.

        Parameters should be a tuple, or list of tuples.
        ie: SELECT ? FROM log;
            parameters = ('module',)
Generic fetch query.  Returns a list of all results.
Generic fetch query . Returns a list of all results .
def fetch(query, parameters=None):
    """ Generic fetch query.  Returns a list of all results.

        Parameters should be a tuple, or list of tuples.
        ie: SELECT ? FROM log;
            parameters = ('module',)
    """
    global db
    try:
        cursor = db.connection.cursor()

        if parameters is None:
            cursor.execute(query)
        else:
            cursor.execute(query, parameters)
        return cursor.fetchall()
    except Exception, e:
        print e
        return None
def fetch ( query , parameters = None ) : global db try : cursor = db . connection . cursor ( ) if parameters is None : cursor . execute ( query ) else : cursor . execute ( query , parameters ) return cursor . fetchall ( ) except Exception , e : print e return None