mardi 5 avril 2016

how to save a select query result in a variable

I'm working in a flask app and, like title suggests, I want to save a 'select query result' (sqlite db) in a variable like this:

    id_ = g.db.execute("SELECT id_user FROM user WHERE name = ?", [username])

but it doesn't work fine. How can I do?

Aucun commentaire:

Enregistrer un commentaire