dimanche 20 mars 2016

Can not get my parameter to work inside SELECT WHERE clause in python

So I made a function that takes as a parameter a string and then uses a select where clause to get the values for just that parameter, but for some reason it will not work. I've tried (ar), "ar", '%s'%ar None of those are working for me please help

def getLoc(ar):
    cursor = conn.execute("SELECT location.name from area,location WHERE area.name = ***(ar)*** ")


get_locations_for_area("Columbia")
conn.close()

Aucun commentaire:

Enregistrer un commentaire