import sqlite3


def sample_in_db(sample, serie, db, table):
    """Check if sample-serie combi is in database. Return boolean."""
    sql = """SELECT * FROM {}
    WHERE(SAMPLE='{}' AND SERIE='{}')
    """.format(table, sample, str(serie))

    conn = sqlite3.connect(db)
    c = conn.cursor()
    c.execute(sql)

    if c.fetchone():
        conn.close()
        return True
    else:
        conn.close()
        return False