Re: Some More MySQL

2010-05-28 Thread MRAB
Victor Subervi wrote: I still have this code: sql = 'select * from options%s where ID=%%s', (opTable[0].upper() + opTable[1:]) cursor.execute(sql, (id,)) which throws this error: /var/www/html/angrynates.com/cart/enterOptionsPrices2.py

Re: Some More MySQL

2010-05-28 Thread Victor Subervi
I still have this code: sql = 'select * from options%s where ID=%%s', (opTable[0].upper() + opTable[1:]) cursor.execute(sql, (id,)) which throws this error: /var/www/html/angrynates.com/cart/enterOptionsPrices2.py 70 print 'All options prices have been successfully updated.'

Re: Some More MySQL

2010-05-28 Thread Kushal Kumaran
On Fri, May 28, 2010 at 5:46 PM, Victor Subervi wrote: > On Fri, May 28, 2010 at 2:17 AM, Dennis Lee Bieber > wrote: >> >> On Thu, 27 May 2010 23:22:24 +0100, MRAB >> declaimed the following in gmane.comp.python.general: >> >> > >> > Placeholders which are handled by .execute shouldn't be wrappe

Re: Some More MySQL

2010-05-28 Thread Victor Subervi
On Fri, May 28, 2010 at 2:17 AM, Dennis Lee Bieber wrote: > On Thu, 27 May 2010 23:22:24 +0100, MRAB > declaimed the following in gmane.comp.python.general: > > > > > Placeholders which are handled by .execute shouldn't be wrapped in > > quotes, even is the value is a string, because .execute wil

Re: Some More MySQL

2010-05-27 Thread MRAB
Victor Subervi wrote: On Thu, May 27, 2010 at 2:54 PM, MRAB > wrote: Victor Subervi wrote: Hi; But what about this? sql = "select pic%d from %s where ID='%%s';" % (pic, store) cursor.execute(sql % id) If I try an

Re: Some More MySQL

2010-05-27 Thread Victor Subervi
On Thu, May 27, 2010 at 2:54 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> But what about this? >> >> sql = "select pic%d from %s where ID='%%s';" % (pic, store) >> cursor.execute(sql % id) >> >> If I try and rewrite the last line like this: >> >> cursor.execute(sql, id) >> >> it doesn't

Re: Some More MySQL

2010-05-27 Thread MRAB
Victor Subervi wrote: Hi; But what about this? sql = "select pic%d from %s where ID='%%s';" % (pic, store) cursor.execute(sql % id) If I try and rewrite the last line like this: cursor.execute(sql, id) it doesn't work. What do? How about this one: cursor.execute("insert into c

Some More MySQL

2010-05-27 Thread Victor Subervi
Hi; But what about this? sql = "select pic%d from %s where ID='%%s';" % (pic, store) cursor.execute(sql % id) If I try and rewrite the last line like this: cursor.execute(sql, id) it doesn't work. What do? How about this one: cursor.execute("insert into categories (Store, Catego