From: Michael Dykman Date: October 5 2009 12:10am Subject: Re: No tuples, but AttributeError about tuple! List-Archive: http://lists.mysql.com/mysql/218953 Message-Id: <814b9a820910041710m4941d07fr3d640843aa1b0e8e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 wr= ote: > Hi; > I have the following python code: > =A0 =A0 =A0sql =3D '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, constructio= n, > location, estate, address, furnished, pic1, pic2, pic3, pic4, pic5, pic6) > =A0 =A0 =A0cursor.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 i= t > 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 > --=20 - michael dykman - mdykman@stripped Don=92t worry about people stealing your ideas. If they=92re any good, you=92ll have to ram them down their throats! Howard Aiken