import sqlite3


def meals_lookup(user_id):
    """Query database for meals specified by user"""
    conn = sqlite3.connect('shopping.db')
    db = conn.cursor()

    c = db.execute("SELECT meal FROM meals WHERE id = ?", (user_id,))
    output = c.fetchall()
    conn.close()
    meals = []
    for i in output:
        meals.append(i[0])

    return meals