In Pset7, history, I'm trying to sort the data by date, I tried ORDER BY but it gave me"syntax error near when"(when is the date column name, and its data type is: DATETIME) .. what is the right way to do it??
rows=db.execute("SELECT * FROM portfolio WHERE id=:id AND howMany >= 0 UNION SELECT * FROM sell WHERE id=:idd ORDER BY when "
,id=session["user_id"], idd=session["user_id"])
JOIN sell ON sell.id=portfolio.id
(if this makes sense at all)? The table layout looks quite odd, usually you'd prefix foreign keys, likeuser_id
, and useid
for a primary key of that table.static
directory. The templatelayout.html
for example includesstyles.css
using some Jinja within the HTML link element:<link href="{{ url_for('static', filename='styles.css') }}" rel="stylesheet"/>
(this is replaced with/static/styles.css
on runtime, you could also use a static link, doesn't matter as long as paths don't change)