Re: Why isn't this query working in python?

2007-06-25 Thread erikcw
On May 27, 11:06 pm, Steve Holden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On May 27, 2007, at 4:01 PM, Steve Holden wrote: erikcwwrote: On May 26, 8:21 pm, John Machin [EMAIL PROTECTED] wrote: On May 27, 5:25 am,erikcw[EMAIL PROTECTED] wrote: On May 25, 11:28 am, Carsten

Re: Why isn't this query working in python?

2007-05-29 Thread erikcw
On May 28, 2:47 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 28 May 2007 14:53:57 -0300, Dennis Lee Bieber [EMAIL PROTECTED] escribió: On Sun, 27 May 2007 20:35:28 -0400, Carsten Haese [EMAIL PROTECTED] declaimed the following in comp.lang.python: On Sun, 2007-05-27 at 16:39

Re: Why isn't this query working in python?

2007-05-29 Thread Steve Holden
erikcw wrote: On May 28, 2:47 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 28 May 2007 14:53:57 -0300, Dennis Lee Bieber [EMAIL PROTECTED] escribió: On Sun, 27 May 2007 20:35:28 -0400, Carsten Haese [EMAIL PROTECTED] declaimed the following in comp.lang.python: On Sun, 2007-05-27

Re: Why isn't this query working in python?

2007-05-28 Thread Gabriel Genellina
En Mon, 28 May 2007 14:53:57 -0300, Dennis Lee Bieber [EMAIL PROTECTED] escribió: On Sun, 27 May 2007 20:35:28 -0400, Carsten Haese [EMAIL PROTECTED] declaimed the following in comp.lang.python: On Sun, 2007-05-27 at 16:39 -0400, [EMAIL PROTECTED] wrote: sql = SELECT

Re: Why isn't this query working in python?

2007-05-27 Thread erikcw
On May 26, 8:21 pm, John Machin [EMAIL PROTECTED] wrote: On May 27, 5:25 am, erikcw [EMAIL PROTECTED] wrote: On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote: I'm trying to run the following query: ...

Re: Why isn't this query working in python?

2007-05-27 Thread Steve Howell
--- erikcw [EMAIL PROTECTED] wrote: ('SELECT payment_id FROM amember_payments WHERE member_id=%s AND expire_date NOW() AND completed=1 AND (product_id 11 AND product_id 21)', (1608L,)) () Here is a copy of the table schema and the first 2 rows. Does your table actually

Re: Why isn't this query working in python?

2007-05-27 Thread Steve Holden
Steve Howell wrote: --- erikcw [EMAIL PROTECTED] wrote: ('SELECT payment_id FROM amember_payments WHERE member_id=%s AND expire_date NOW() AND completed=1 AND (product_id 11 AND product_id 21)', (1608L,)) () Here is a copy of the table schema and the first 2 rows. Does your table

Re: Why isn't this query working in python?

2007-05-27 Thread Steve Holden
erikcw wrote: On May 26, 8:21 pm, John Machin [EMAIL PROTECTED] wrote: On May 27, 5:25 am, erikcw [EMAIL PROTECTED] wrote: On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote: I'm trying to run the following query: ...

Re: Why isn't this query working in python?

2007-05-27 Thread davelist
On May 27, 2007, at 4:01 PM, Steve Holden wrote: erikcw wrote: On May 26, 8:21 pm, John Machin [EMAIL PROTECTED] wrote: On May 27, 5:25 am, erikcw [EMAIL PROTECTED] wrote: On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote:

Re: Why isn't this query working in python?

2007-05-27 Thread erikcw
On May 27, 4:01 pm, Steve Holden [EMAIL PROTECTED] wrote: erikcw wrote: On May 26, 8:21 pm, John Machin [EMAIL PROTECTED] wrote: On May 27, 5:25 am, erikcw [EMAIL PROTECTED] wrote: On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51 -0500, Dave Borne

Re: Why isn't this query working in python?

2007-05-27 Thread Carsten Haese
On Sun, 2007-05-27 at 16:39 -0400, [EMAIL PROTECTED] wrote: sql = SELECT payment_id FROM amember_payments WHERE member_id=%s AND expire_date NOW() AND completed=1 AND (product_id 11 AND product_id 21), (self.uid) And doesn't the above comma, need to be a percent symbol?

Re: Why isn't this query working in python?

2007-05-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: On May 27, 2007, at 4:01 PM, Steve Holden wrote: erikcw wrote: On May 26, 8:21 pm, John Machin [EMAIL PROTECTED] wrote: On May 27, 5:25 am, erikcw [EMAIL PROTECTED] wrote: On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51

Re: Why isn't this query working in python?

2007-05-26 Thread erikcw
On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote: I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead of '%s' ?

Re: Why isn't this query working in python?

2007-05-26 Thread Steve Holden
erikcw wrote: On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote: I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead

Re: Why isn't this query working in python?

2007-05-26 Thread Carsten Haese
On Sat, 2007-05-26 at 12:25 -0700, erikcw wrote: I tried adding the comma to make it a sequence - but now change. ('SELECT payment_id FROM amember_payments WHERE member_id=%s AND expire_date NOW() AND completed=1 AND (product_id 11 AND product_id 21)', (1608L,)) () What else could it

Re: Why isn't this query working in python?

2007-05-26 Thread John Machin
On May 27, 5:25 am, erikcw [EMAIL PROTECTED] wrote: On May 25, 11:28 am, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote: I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id

Why isn't this query working in python?

2007-05-25 Thread erikcw
Hi all, I'm trying to run the following query: amember_db = MySQLdb.connect(host=localhost, user=**, passwd=*, db=***) # create a cursor self.amember_cursor = amember_db.cursor() # execute SQL statement sql = SELECT payment_id FROM

Re: Why isn't this query working in python?

2007-05-25 Thread Dave Borne
I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead of '%s' ? (I'm asking because I'm not entirely sure how the execute command is doing the substitution) -Dave --

Re: Why isn't this query working in python?

2007-05-25 Thread erikcw
On May 25, 10:51 am, Dave Borne [EMAIL PROTECTED] wrote: I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead of '%s' ? (I'm asking because I'm not entirely sure how the execute

Re: Why isn't this query working in python?

2007-05-25 Thread Carsten Haese
On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote: I'm trying to run the following query: ... member_id=%s AND expire_date NOW() AND completed=1 AND (product_id Shouldn't you be using the bind variable '?' instead of '%s' ? The parameter placeholder for MySQLdb is, indeed and