Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42083

Re: Cannot run a single MySQLdb execute....

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 <rosuav@gmail.com>
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 <c0c16d2d-b4b2-4d7a-8f1e-606ee2030ad9@googlegroups.com>
References <c0c16d2d-b4b2-4d7a-8f1e-606ee2030ad9@googlegroups.com>
Date Thu, 28 Mar 2013 15:00:17 +1100
Subject Re: Cannot run a single MySQLdb execute....
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3849.1364443225.2939.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Thu, Mar 28, 2013 at 2:50 PM, Νίκος Γκρ33κ <nikos.gr33k@gmail.com> 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 = ?''', (page,) )
> data = cur.fetchone()
>
> because as you can see by visiting my webpage at http://superhost.gr it produces 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' = ANSI C printf format
codes, e.g. '...WHERE name=%s'. If a mapping object is used for
conn.execute(), then the interface actually uses 'pyformat' = Python
extended format codes, e.g. '...WHERE name=%(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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Cannot run  a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 20:50 -0700
  Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:00 +1100
    Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:03 -0700
      Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:08 -0700
        Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:14 +1100
      Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:08 +1100
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:18 -0700
          Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:26 +1100
            Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:30 -0700
              Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:35 +1100
                Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:39 -0700
                Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:39 -0700
            Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:30 -0700
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:18 -0700
      Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:08 -0700
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 02:44 -0700
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 02:44 -0700
      Re: Cannot run a single MySQLdb execute.... David M Chess <chess@us.ibm.com> - 2013-03-28 10:51 -0400
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 12:35 -0700
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 12:35 -0700
    Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:03 -0700
  Re: Cannot run  a single MySQLdb execute.... Alan Meyer <ameyer2@yahoo.com> - 2013-03-28 16:54 -0400
    Re: Cannot run  a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-29 00:40 -0700
      Re: Cannot run  a single MySQLdb execute.... Alan Meyer <ameyer2@yahoo.com> - 2013-03-29 13:32 -0400
        Re: Cannot run  a single MySQLdb execute.... Alan Meyer <ameyer2@yahoo.com> - 2013-03-29 13:39 -0400
          Re: Cannot run  a single MySQLdb execute.... nagia.retsina@gmail.com - 2013-03-29 12:24 -0700

csiph-web