MySQLdb select

R Baumann ryntatqwest.net
Sat Jul 31 10:55:51 EDT 2004


"Gerhard Häring" <gh at ghaering.de> wrote in message
news:mailman.1008.1091284523.5135.python-list at python.org...
> F. GEIGER wrote:
> > "John Fabiani" <jfabiani at yolo.com> schrieb:

<SNIP>
>
> Then use %i for integers ;-)
>
> > I'm used to do that this way:
> >
> > cursor.execute("SELECT * FROM mytest where clientID = %d" % numb)
>
> That's particularly BAD STYLE. It's best to keep to letting the DB-API
> do the proper quoting for all parameters.
>
> -- Gerhard

Gerhard,  I really have no intention of starting a pissing match with you or
anyone else on this ng,  but when you tell someone else that a particular
piece of code is BAD STYLE without showing an example of GOOD STYLE, it
pisses me off.  The newbies here (myself included) don't learn anything, and
IMO, that what the newsgroups are for, to pass along hints, tips, and
knowledge from people who DO know what's right and what's wrong.  How about
an example?

Thanks
Ruben





More information about the Python-list mailing list