def new_user(username, email, password): args = {'name' : username, 'email' : email, 'password' : password} query = "INSERT INTO users (name, email, password) VALUES(%(name)s, %(email)s, %(password)s)" connection.execute_query(query, args)
def new_question(user_id, text): args = {'questioner_id' : user_id, 'body' : text} query = "INSERT INTO questions (questioner_id, body, pub_date) VALUES(%(questioner_id)s, %(body)s, NOW())" connection.execute_query(query, args)