Hi all,
I'm trying to run the following query:
amember_db = MySQLdb.connect (host="localhos t", user="********* *",
passwd="*****", db="*******")
# create a cursor
self.amember_cu rsor = amember_db.curs or()
# execute SQL statement
sql = """SELECT payment_id FROM amember_payment s WHERE
member_id=%s AND expire_date NOW() AND completed=1 AND (product_id
print sql
self.amember_cu rsor.execute(*s ql)
amember_result = self.cursor.fet chall()
print amember_result
When I manually run the SQL query in mysql, I get a result, but for
some reason I get an empty result in python. Here are some notes that
may be of importance.
-I have 2 connections open to MySQL in this script (they are both in
seperate objects of course)
- self.uid = 1972L
-print amember_result = ()
Any ideas?
Thanks!
Erik
I'm trying to run the following query:
amember_db = MySQLdb.connect (host="localhos t", user="********* *",
passwd="*****", db="*******")
# create a cursor
self.amember_cu rsor = amember_db.curs or()
# execute SQL statement
sql = """SELECT payment_id FROM amember_payment s WHERE
member_id=%s AND expire_date NOW() AND completed=1 AND (product_id
>11 AND product_id <21)""", (self.uid)
self.amember_cu rsor.execute(*s ql)
amember_result = self.cursor.fet chall()
print amember_result
When I manually run the SQL query in mysql, I get a result, but for
some reason I get an empty result in python. Here are some notes that
may be of importance.
-I have 2 connections open to MySQL in this script (they are both in
seperate objects of course)
- self.uid = 1972L
-print amember_result = ()
Any ideas?
Thanks!
Erik
Comment