Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:sourceforge': 0.03; 'charset:iso-8859-7': 0.04; 'insert': 0.05; '"""': 0.07; 'column': 0.07; 'string': 0.09; 'formatting': 0.09; 'literal': 0.09; 'parameter': 0.09; 'sql,': 0.09; 'stating': 0.09; 'api': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hits': 0.16; 'marker': 0.16; 'statements,': 0.16; 'subject:run': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; 'help.': 0.21; 'error': 0.23; 'why.': 0.24; 'query': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'constant': 0.31; 'produces': 0.31; 'values.': 0.31; 'interface': 0.32; 'style': 0.33; 'table': 0.34; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'received:google.com': 0.35; 'i.e.': 0.36; 'wrong': 0.37; 'received:209': 0.37; 'expected': 0.38; 'e.g.': 0.38; 'mapping': 0.38; 'presently': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'extended': 0.61; "you're": 0.61; 'such': 0.63; 'skip:n 10': 0.64; 'more': 0.64; 'dont': 0.67; 'mar': 0.68; 'percent': 0.68; 'webpage': 0.68; 'visiting': 0.79; '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=6GiJwYDEUapV10Wf6uTqm9EMYEKy+ut8LegSh/6L2xg=; b=zwKyqk/fjRKsBP52c8CphWpy1XFZe5Vvso0juMu1NOt/o4f0JxuRdRCPsC3/AazOIQ M4/jEtekvjbBFxTz4Ue67PYXj0EDIs02WSklaQQsfvVpPySfVjuamz8OG9XpCn9yGLnk u7oovHVn7MqGHvQPXmRVlGcVYYqgvTny65yM93t0P9e8txEr4XLah1JiEBS28NDZnqWs eopzUUzeQL6pW02hIzd+FdXYRIedhsNqxrJs8xxs452zGfSJnNB81NKphLo+w+Hv3VVO DN/crkxaCIMXB/6OXNbrUgJ+hZxqWQuXrRQ/ua1HLoiycwsaMwuJgJlWPzjuvToMdPLd s5/A== MIME-Version: 1.0 X-Received: by 10.220.223.80 with SMTP id ij16mr26187356vcb.28.1364443217176; Wed, 27 Mar 2013 21:00:17 -0700 (PDT) In-Reply-To: References: Date: Thu, 28 Mar 2013 15:00:17 +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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364443225 news.xs4all.nl 6916 [2001:888:2000:d::a6]:46347 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42083 On Thu, Mar 28, 2013 at 2:50 PM, =CD=DF=EA=EF=F2 =C3=EA=F133=EA wrote: > I'am about to go nuts with python 3.2.3 > > Do you see somehtign wrong with the following statement? > > cur.execute( '''SELECT hits FROM counters WHERE url =3D ?''', (page,) ) > data =3D cur.fetchone() > > because as you can see by visiting my webpage at http://superhost.gr it p= roduces an error and i dont have aclue why. > > Please help. i'am using MySQLdb Is this the docs for the module you're using? http://mysql-python.sourceforge.net/MySQLdb.html """ paramstyle String constant stating the type of parameter marker formatting expected by the interface. Set to 'format' =3D ANSI C printf format codes, e.g. '...WHERE name=3D%s'. If a mapping object is used for conn.execute(), then the interface actually uses 'pyformat' =3D Python extended format codes, e.g. '...WHERE name=3D%(name)s'. However, the API does not presently allow the specification of more than one style in paramstyle. Note that any literal percent signs in the query string passed to execute() must be escaped, i.e. %%. Parameter placeholders can only be used to insert column values. They can not be used for other parts of SQL, such as table names, statements, etc. """ What paramstyle are you using? ChrisA