Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!newsfeed101.telia.com!starscream.dk.telia.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'charset:iso-8859-7': 0.04; 'yet.': 0.04; 'column': 0.07; 'says.': 0.09; '"%s"': 0.16; 'attribute.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hits': 0.16; 'subject:run': 0.16; 'top-level': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; 'print': 0.22; 'error': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'asked': 0.31; 'code': 0.31; 'didnt': 0.31; 'supposed': 0.32; 'says': 0.33; 'received:209.85': 0.35; 'late': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'executing': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'skip:_ 30': 0.39; 'to:addr:python.org': 0.39; 'tell': 0.60; 'no.': 0.61; 'more': 0.64; 'here': 0.66; 'mar': 0.68; 'yes': 0.68; 'webpage': 0.68; 'greece': 0.84; '\xcc\xe1\xf1\xf4\xdf\xef\xf5': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=vkBukpby9RF3rzU2hxdTs8E8bs2b0zcNaagv2U5QO00=; b=H5H7Byf0tiA11g8zffMRxDz9sA53pc2faVuOwEsQc8zjI5ZHi6ctNmXyfdyWRrOOZz QMY4Fl4uyqGH7nhui2PMGwNz5xWtbSKlnoa8o/dLpZHWsyerKVsRebB2J5PC7Q12OBmq pmwUOvmZcVJJov9Q6wV2bWawtvAwEWnoJoJYXxI/CMQKQh2Q0fi+By/b75S1y6lWI0zN UDXkKRb6DiO75NQHDCflYlaEsiBnduDSLVNCM0UPLQtkvcvXtgrThHb6/nL6JxkyhKo/ c8+q+uIbd7RsBKY9RXkRF0hiOKOpNCMHYsz8Gtm0b/0rCEALdA38Byc8vVrzYqwgPAxN dlmQ== MIME-Version: 1.0 X-Received: by 10.52.111.130 with SMTP id ii2mr11026130vdb.111.1364445314765; Wed, 27 Mar 2013 21:35:14 -0700 (PDT) In-Reply-To: References: <2ac959c6-d169-452f-b622-83fe25fbd8da@googlegroups.com> <19fcf06e-8923-410c-9acd-abd4534c77bf@googlegroups.com> Date: Thu, 28 Mar 2013 15:35:14 +1100 Subject: Re: Cannot run a single MySQLdb execute.... From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 59 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364445317 news.xs4all.nl 6876 [2001:888:2000:d::a6]:53066 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42094 On Thu, Mar 28, 2013 at 3:30 PM, =CD=DF=EA=EF=F2 =C3=EA=F133=EA wrote: > =D4=E7 =D0=DD=EC=F0=F4=E7, 28 =CC=E1=F1=F4=DF=EF=F5 2013 6:26:48 =F0.=EC.= UTC+2, =EF =F7=F1=DE=F3=F4=E7=F2 Chris Angelico =DD=E3=F1=E1=F8=E5: >> On Thu, Mar 28, 2013 at 3:18 PM, =CD=DF=EA=EF=F2 =C3=EA=F133=EA wrote: >> >> > =D4=E7 =D0=DD=EC=F0=F4=E7, 28 =CC=E1=F1=F4=DF=EF=F5 2013 6:08:28 =F0.= =EC. UTC+2, =EF =F7=F1=DE=F3=F4=E7=F2 Chris Angelico =DD=E3=F1=E1=F8=E5: >> >> > >> >> >> As it says in that document, paramstyle is a top-level module >> >> >> attribute. Try printing it out. See what it says. Then match your cod= e >> >> > >> >> > sql =3D '''SELECT hits FROM counters WHERE url =3D %s''' % page >> >> > print( sql ) >> >> > cur.execute( sql ) >> >> > >> >> > Now the error says: >> >> > >> >> > _mysql_exceptions.OperationalError: (1054, "Unknown column 'index.html= ' in 'where clause'") as you cna see at my webpage >> >> >> >> http://www.facepalm.de/ >> >> >> >> Do you understand SQL injection attacks and the concept of >> >> parameterized queries? >> >> >> >> ChrisA > > Yes i know i'am not supposed to use "%s" and i dotn want to but you asked= me to print the sql statemnt before executing it. > > please its 6:30am here in greece and didnt had any sleep yet. > please tell me whats wrong.... No. I said to print out the paramstyle attribute. If it's that late and you haven't slept, get some sleep, then reread this thread. You may be able to respond more intelligently. ChrisA