Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
> > > > > > > > > The problem here is that only one of the images prints on the said page! > > However, if I surf to those URLs, the images appear! > > Are you sure that you're surfing to *exactly* those URLs? When I go to > http://www.angrynates.com/cart/getpic.py?pic=2&id=1, I get an image, but

Re: Can't Encode Pic

2009-11-27 Thread Carsten Haese
Victor Subervi wrote: > On Fri, Nov 27, 2009 at 12:13 PM, Carsten Haese > wrote: > > Victor Subervi wrote: > > The difficulty I am having is that for > > some reason it's not inserting. The form inserts the first image > but not > > the second.

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Fri, Nov 27, 2009 at 1:43 PM, Dennis Lee Bieber wrote: > On Fri, 27 Nov 2009 05:59:39 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > > > > > > The following complained that there weren't enough arguments: > > > > for pic in pics: > > sql = '

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Fri, Nov 27, 2009 at 12:13 PM, Carsten Haese wrote: > Victor Subervi wrote: > > The difficulty I am having is that for > > some reason it's not inserting. The form inserts the first image but not > > the second. > > My guess is that you're not calling db.commit() after inserting the > second im

Re: Can't Encode Pic

2009-11-27 Thread Carsten Haese
Victor Subervi wrote: > The difficulty I am having is that for > some reason it's not inserting. The form inserts the first image but not > the second. My guess is that you're not calling db.commit() after inserting the second image. (If you had shown your code, I wouldn't have to guess.) HTH, -

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Fri, Nov 27, 2009 at 9:02 AM, Rami Chowdhury wrote: > On Fri, Nov 27, 2009 at 02:59, Victor Subervi > wrote: > > On Thu, Nov 26, 2009 at 5:08 PM, Dennis Lee Bieber < > wlfr...@ix.netcom.com> > > wrote: > >> Nothing hinting at having > >> opened an interactive Python console and typing statemen

Re: Can't Encode Pic

2009-11-27 Thread Rami Chowdhury
On Fri, Nov 27, 2009 at 02:59, Victor Subervi wrote: > On Thu, Nov 26, 2009 at 5:08 PM, Dennis Lee Bieber > wrote: >> Nothing hinting at having >> opened an interactive Python console and typing statements into it as an >> experiment to see what may work, or what changes may break something. > >

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Thu, Nov 26, 2009 at 5:08 PM, Dennis Lee Bieber wrote: > On Thu, 26 Nov 2009 13:32:12 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > > A problem occurred in a Python script. Here is the sequence of function > > calls leading up to the error, in the order

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 2:12 PM, MRAB wrote: > Victor Subervi wrote: > >> On Thu, Nov 26, 2009 at 1:10 PM, Victor Subervi >> > victorsube...@gmail.com>> wrote: >> >>On Thu, Nov 26, 2009 at 11:52 AM, MRAB >> wrote: >> >>Victor Subervi wrote: >> >

Re: Can't Encode Pic

2009-11-26 Thread MRAB
Victor Subervi wrote: On Thu, Nov 26, 2009 at 1:10 PM, Victor Subervi > wrote: On Thu, Nov 26, 2009 at 11:52 AM, MRAB mailto:pyt...@mrabarnett.plus.com>> wrote: Victor Subervi wrote: On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese

Re: Can't Encode Pic

2009-11-26 Thread Carsten Haese
Victor Subervi wrote: > Hang on. Not done yet. The line of code I gave you was just a test case. > The real ones, and the error they threw, follows: > [...] >73 cursor.execute(sql, (MySQLdb.Binary(pics[id]),)) > [...] > > TypeError: list indices must be integers > args = ('list i

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 1:10 PM, Victor Subervi wrote: > On Thu, Nov 26, 2009 at 11:52 AM, MRAB wrote: > >> Victor Subervi wrote: >> >>> On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese >>> >> carsten.ha...@gmail.com>> wrote: >>> >>>cursor.execute('update products set pic1=%s where ID=1', >>>

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 11:52 AM, MRAB wrote: > Victor Subervi wrote: > >> On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese >> > carsten.ha...@gmail.com>> wrote: >> >>cursor.execute('update products set pic1=%s where ID=1', >>(MySQLdb.Binary(pic1),)) >> >>[That comma between the two c

Re: Can't Encode Pic

2009-11-26 Thread MRAB
Victor Subervi wrote: On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese > wrote: cursor.execute('update products set pic1=%s where ID=1', (MySQLdb.Binary(pic1),)) [That comma between the two closing parentheses is not a typo. Do not leave it out!]

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese wrote: > cursor.execute('update products set pic1=%s where ID=1', > (MySQLdb.Binary(pic1),)) > > [That comma between the two closing parentheses is not a typo. Do not > leave it out!] > A problem occurred in a Python script. Here is the sequence of

Re: Can't Encode Pic

2009-11-26 Thread Carsten Haese
Victor Subervi wrote: > Hi; > I have the following code: > > import cgitb; cgitb.enable() > import cgi > import MySQLdb > from login import login > user, passwd, db, host = login() > db = MySQLdb.connect(host, user, passwd, db) > cursor= db.cursor() > form = cgi.FieldStorage() > pic1 = form.getfir

Can't Encode Pic

2009-11-26 Thread Victor Subervi
Hi; I have the following code: import cgitb; cgitb.enable() import cgi import MySQLdb from login import login user, passwd, db, host = login() db = MySQLdb.connect(host, user, passwd, db) cursor= db.cursor() form = cgi.FieldStorage() pic1 = form.getfirst('pic1') cursor.execute('update products set