Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.96; '*S*': 0.00; 'charset:iso-8859-7': 0.04; 'encoding': 0.05; 'mrab': 0.05; 'column': 0.07; "'%s':": 0.16; 'clear.': 0.16; 'comma': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hits': 0.16; 'placeholder': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'thu,': 0.19; 'error': 0.23; 'tells': 0.24; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'received:209.85': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'changing': 0.37; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'that,': 0.38; 'skip:_ 30': 0.39; 'to:addr:python.org': 0.39; 'read': 0.60; "you've": 0.63; 'more': 0.64; 'subject:. ': 0.67; 'mar': 0.68; 'attacks.': 0.84; 'opens': 0.91; 'responses': 0.93; '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=h44TvuhtMVWRydXwsxxaFLcNDFWVmNzVnCXTcZS7gXg=; b=rV/9fGSDF2SXgoRUDX/9lyERIF6GP9lAWDokoysACf9+Ll6FTV2gItMQp9K7PQ5+2O u2DMOL1HiKJbBtUo8fAIjgM5nGiL+/ndtoO3K0HHL0qJOO1Y0FzlDqpOl3TOROeTQV+q mvJI43Ny8+6VMKpNBaoOk0lhNHSNh/isbKB3poL0kiouNSaMePc1h8YAtmN1Eki91czW smGOXIB/a8tevdIHS43qZxydshxxYyjCBlHZpLlaWsNF0t605CTFpnC+8JpJ4GdW3H52 TqZrSObIk+t1T3ycwzxPe0qslmtQG0ZlUJ6FwdCtkH9Lxs5hPuimniR7/Vo0A2yb7Rj6 0XVA== MIME-Version: 1.0 X-Received: by 10.58.50.7 with SMTP id y7mr24781895ven.24.1364412515825; Wed, 27 Mar 2013 12:28:35 -0700 (PDT) In-Reply-To: <8ada8de4-1cb2-4fbb-ae4f-8c0d47c1cf40@googlegroups.com> References: <9c01c631-77e8-4104-ae1f-5cccfaaea10d@googlegroups.com> <22f50ec2-7d20-47af-a793-5cf801b6a23e@googlegroups.com> <8ada8de4-1cb2-4fbb-ae4f-8c0d47c1cf40@googlegroups.com> Date: Thu, 28 Mar 2013 06:28:35 +1100 Subject: Re: MySQLdbd error. Perhpas it isn't installed? 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364412524 news.xs4all.nl 6880 [2001:888:2000:d::a6]:52697 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42032 On Thu, Mar 28, 2013 at 5:48 AM, =CD=DF=EA=EF=F2 =C3=EA=F133=EA wrote: > I had encoding isseus as well! > > Now i tried your suggestion changing comma with '%' and now the error is = more clear. > > [code] > _mysql_exceptions.OperationalError: (1054, "Unknown column 'index.html' i= n 'where clause'") > [/code] No, don't do that, that opens you up to SQL injection attacks. Read the responses you've been given: On Thu, Mar 28, 2013 at 3:48 AM, MRAB wrote: > A brief look at the documentation tells me that MySQL uses '?' as the > placeholder instead of '%s': > > cur.execute('''SELECT hits FROM counters WHERE url =3D ?''', (page, )) This is what you need to do. ChrisA