0

I'm about to go nuts with python 3.2.3

Do you see something 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 don't know why.

I'm using MySQLdb.

Ι'm using '?' or '%s'; the latter used to work flawlessly with python 2.6, but it does not in python 3.2.3

Both these commands fail in python 3.2.3

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

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

Any idea why?

4

1 に答える 1