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


Groups > comp.lang.python > #42032

Re: MySQLdbd error. Perhpas it isn't installed?

References (1 earlier) <9c01c631-77e8-4104-ae1f-5cccfaaea10d@googlegroups.com> <22f50ec2-7d20-47af-a793-5cf801b6a23e@googlegroups.com> <mailman.3813.1364402927.2939.python-list@python.org> <mailman.3817.1364409562.2939.python-list@python.org> <8ada8de4-1cb2-4fbb-ae4f-8c0d47c1cf40@googlegroups.com>
Date 2013-03-28 06:28 +1100
Subject Re: MySQLdbd error. Perhpas it isn't installed?
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3821.1364412524.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Mar 28, 2013 at 5:48 AM, Νίκος Γκρ33κ <nikos.gr33k@gmail.com> 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' in '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 <python@mrabarnett.plus.com> 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 = ?''', (page, ))

This is what you need to do.

ChrisA

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


Thread

MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-26 14:24 -0700
  Re: MySQLdbd error. Perhpas it isn't installed? MRAB <python@mrabarnett.plus.com> - 2013-03-27 00:41 +0000
  Re: MySQLdbd error. Perhpas it isn't installed? rurpy@yahoo.com - 2013-03-26 21:26 -0700
    Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-26 23:42 -0700
      Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 00:26 -0700
        Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 02:58 -0700
      Re: MySQLdbd error. Perhpas it isn't installed? MRAB <python@mrabarnett.plus.com> - 2013-03-27 16:48 +0000
        Re: MySQLdbd error. Perhpas it isn't installed? nagia.retsina@gmail.com - 2013-03-27 11:15 -0700
        Re: MySQLdbd error. Perhpas it isn't installed? nagia.retsina@gmail.com - 2013-03-27 11:15 -0700
        Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 11:27 -0700
        Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 11:27 -0700
          Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 11:48 -0700
            Re: MySQLdbd error. Perhpas it isn't installed? Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-27 15:06 -0400
              Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 12:13 -0700
              Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 12:13 -0700
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 12:23 -0700
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 12:23 -0700
            Re: MySQLdbd error. Perhpas it isn't installed? Chris Angelico <rosuav@gmail.com> - 2013-03-28 06:28 +1100
              Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 12:42 -0700
              Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 12:42 -0700
          Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 11:48 -0700
      Re: MySQLdbd error. Perhpas it isn't installed? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-03-27 18:48 -0400
        Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:17 -0700
          Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:19 -0700
            Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:24 -0700
              Re: MySQLdbd error. Perhpas it isn't installed? Chris Angelico <rosuav@gmail.com> - 2013-03-28 13:33 +1100
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:36 -0700
                Re: MySQLdbd error. Perhpas it isn't installed? Chris Angelico <rosuav@gmail.com> - 2013-03-28 13:46 +1100
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:57 -0700
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:57 -0700
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 20:54 -0700
                Re: MySQLdbd error. Perhpas it isn't installed? Chris Angelico <rosuav@gmail.com> - 2013-03-28 14:57 +1100
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 20:54 -0700
                Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:36 -0700
            Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:24 -0700
            Re: MySQLdbd error. Perhpas it isn't installed? Chris Angelico <rosuav@gmail.com> - 2013-03-28 13:31 +1100
          Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:19 -0700
        Re: MySQLdbd error. Perhpas it isn't installed? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 19:17 -0700

csiph-web