MySQLdbd error. Perhpas it isn't installed?

Νίκος Γκρ33κ nikos.gr33k at gmail.com
Thu Mar 28 03:17:34 CET 2013


Τη Πέμπτη, 28 Μαρτίου 2013 12:48:54 π.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε:
> On Wed, 27 Mar 2013 16:48:44 +0000, MRAB <python at mrabarnett.plus.com>
> 
> declaimed the following in gmane.comp.python.general:
> 
> 
> 
> 
> 
> > 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, ))
> 
> 
> 
> 	What documentation is that from... MySQLdb has used %s for ages (if
> 
> you look at the source code of the adapter, it actually uses Python's
> 
> string interpolation to fill in the SQL /after/ it has escaped/quoted
> 
> each parameter.
> 
> 
> 
> 	Now, I don't know about the recent "pure Python" MySQL adapter...
> 
> -- 
> 
> 	Wulfraed                 Dennis Lee Bieber         AF6VN
> 
>         wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/

So dod i have to use '%s' or (?) what is better? and as for the synatx that i asked in my previous post? what is the correct one?



More information about the Python-list mailing list