def read_tickers(con, ticker='', comparison='<>"i"'):
    """
    INPUTS:
        con (mysql) - pymysql database connection
        ticker (str) - Ticker symbol on the S&P 500
        comparison (str) - Default is to ignore inactivated tickers, 'i'.
                           Other flags are 'a' for active, and 'n' for new.
    OUTPUT:
        Returns a tuple with the count, and ticker data in dictionary form
        with ticker symbols as keys.
    """

    data = dict()
    sql = """SELECT ticker, id, flag, name, sector, last_update
             FROM symbols WHERE flag{}""".format(comparison)
    if ticker: sql += " AND ticker='{}'".format(ticker)
    with con.cursor() as cur:
        number = cur.execute(sql)
        rows = cur.fetchall()

    for row in rows:
        data[row[0]] = row[1:]

    return (number, data)