MySQLdbd error. Perhpas it isn't installed?

Νίκος Γκρ33κ nikos.gr33k at
Wed Mar 27 20:42:22 CET 2013

Τη Τετάρτη, 27 Μαρτίου 2013 9:28:35 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε:

> On Thu, Mar 28, 2013 at 3:48 AM, MRAB <python at> 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.

The following works in python 2.6

	cur.execute( '''SELECT hits FROM counters WHERE url = %s''') , (page,)

is there a difefrence between the above and the follwong which works in python 3.x

	cur.execute( '''SELECT hits FROM counters WHERE url = %s''' , (page,) )

I'am confused. Which one is the correct?

Also now seems to stuck in the following line which i try to open an acii file to slect a random line, please take a look.

More information about the Python-list mailing list