def post_list_mentions(db, usernick, limit=50):
    """Return a list of posts that mention usernick, ordered by date
    db is a database connection (as returned by COMP249Db())
    return at most limit posts (default 50)

    Returns a list of tuples (id, timestamp, usernick, avatar, content)
    """
    list = []
    cursor = db.cursor()
    sql = """select id, timestamp, usernick, avatar, content from posts,
    users where posts.usernick = users.nick order by timestamp desc"""
    cursor.execute(sql)
    query = cursor.fetchall()
    length = len(query)
    for index in range(length):
        if usernick in query[index][4]:
            list.append(query[index])
    return list