Need help retrieving boolean value using MySQLdb
Posted by: daniel powell
Date: October 23, 2013 01:09PM
I have code written in python that accesses a Mysql database via the Mysqldb library. I can succesfully connect to the database and execute a query which then returns a value representing how many rows in the table matched the query requirments. What I can't seem to figure out is how to return the actuall value of the boolean feild I'm trying to access. Here is my code snippet.
db = MySQLdb.connect(host="localhost", user="pi", passwd="raspberry", db="django_website_db")
cur = db.cursor()
update_kill = cur.execute("SELECT preprogramUpdate FROM website_preprogram WHERE preprogramNumber= 3")
rows = cur.fetchall()
for row in rows:
So to reiterate, I'm trying to return the actuall value of "preprogramUpdate" in my query.....
Thanks in advance for any help!
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.