List:General Discussion« Previous MessageNext Message »
From:Michael Dykman Date:October 5 2009 12:10am
Subject:Re: No tuples, but AttributeError about tuple!
View as plain text  
This looks like much more of a python question than a MySQL question..
 I'll reply offline.

 - michael dykman

On Sun, Oct 4, 2009 at 2:04 PM, Victor Subervi <victorsubervi@stripped> wrote:
> Hi;
> I have the following python code:
>      sql = 'insert into products values(%s, %s, %s, %s, %s, %s, %s,
> %s, %s,
> %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);', (id, name, title,
> description, price, bedrooms, bathrooms, conditions, acreage, construction,
> location, estate, address, furnished, pic1, pic2, pic3, pic4, pic5, pic6)
>      cursor.execute(sql)
> which, when printed to screen, gives the following:
> insert into products values ('1', 'name1', 'title1', 'descr1', '1.1', '2',
> '1', 'New', '1.5', 'new', 'princesse', 'princesse', '123 princesse', 'Not
> furnished', '', '', '', '', '', '');
> which I can enter into the database directly. However, when I try to do it
> through the script, I get the following error:
> AttributeError: 'tuple' object has no attribute 'encode'
> Why is that? There are no tuples here!! Nothing but strings!!
> TIA,
> Victor

 - michael dykman
 - mdykman@stripped

Don’t worry about people stealing your ideas. If they’re any good,
you’ll have to ram them down their throats!

   Howard Aiken
No tuples, but AttributeError about tuple!Victor Subervi4 Oct
  • Re: No tuples, but AttributeError about tuple!Michael Dykman5 Oct
Re: No tuples, but AttributeError about tuple!Victor Subervi5 Oct
Re: No tuples, but AttributeError about tuple!Victor Subervi6 Oct