🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #323

Re: mysql + python

#323
From: Ogryzek
Date: Tue, 10 Dec 2002 15:51
25 lines
1800 bytes
Zrobilem tak
    maxQuery = "select max(pmid) from pub_authors"
    try:
        maxQuery_cursor = db.cursor()
        maxQuery_wyniki = maxQuery_cursor.execute(maxQuery)
        idRow = maxQuery_cursor.fetchone()
        highid = idRow[0]
        self.nextid = highid + 1
    except:
        self.nextid = 0
    if not self.nextid:
        self.nextid = 1

i to pieknie dziala
ale gdy wstawiam wartosc self.nextid do wyrazenia sql to wyrzuca mi blad:
illegal argument type for built-in operatio
a wyrazenie wyglada tak:

    sqlstr = "insert into pub_auhtors values('"+self.nextid+"')"

probowalem konwertowac self.nextid na int, czyli int(self.nextid) ale to nie
pomaga, i jestem juz glupi co tu trzeba zrobic zeby to zadzialalo.

Pozdrawiam
Lukasz Slowik alias Ogryzek
Technical Details
Message-ID: <at52oi$9i6$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!lublin.pl!news.onet.pl!not-for-mail
References: <at4cc9$fs7$1@news.onet.pl> <at4mi4$fo6$1@news.tpi.pl> <at50v9$1du$1@news.onet.pl> <slrnavc2d3.jg.gminick@hannibal.localdomain>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!lublin.pl!news.onet.pl!not-for-mail
From: "Ogryzek" <slukas5@poczta.onet.pl>
Newsgroups: pl.comp.lang.python
Subject: Re: mysql + python
Date: Tue, 10 Dec 2002 16:51:09 +0100
Organization: news.onet.pl
Lines: 27
Sender: slukas5@poczta.onet.pl@228-mia-4.acn.waw.pl
Message-ID: <at52oi$9i6$1@news.onet.pl>
References: <at4cc9$fs7$1@news.onet.pl> <at4mi4$fo6$1@news.tpi.pl> <at50v9$1du$1@news.onet.pl> <slrnavc2d3.jg.gminick@hannibal.localdomain>
NNTP-Posting-Host: 228-mia-4.acn.waw.pl
X-Trace: news.onet.pl 1039535698 9798 212.76.47.228 (10 Dec 2002 15:54:58 GMT)
X-Complaints-To: abuse@onet.pl
NNTP-Posting-Date: 10 Dec 2002 15:54:58 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit