MySQLdbd error. Perhpas it isn't installed?

Chris Angelico rosuav at gmail.com
Wed Mar 27 15:28:35 EDT 2013


On Thu, Mar 28, 2013 at 5:48 AM, Νίκος Γκρ33κ <nikos.gr33k at 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 at 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



More information about the Python-list mailing list