update images inside a mysql database
Jonas Meurer
jonas at freesources.org
Fri Feb 25 11:23:48 EST 2005
On 25/02/2005 Dennis Lee Bieber wrote:
> On Thu, 24 Feb 2005 23:10:48 +0100, Jonas Meurer <jonas at freesources.org>
> declaimed the following in comp.lang.python:
>
>
> > version used placeholders as well. anyway, i changed my code to resemble
>
> "resemble" is the key... It is NOT the correct sample.
>
> > 261 db_connect.cursor.execute("""UPDATE Images SET Image=%s WHERE
> > 262 ImgID = %s""" % (image, imgid))
> 262 ImgID = %s""" , (image, imgid))
>
> The .execute method ITSELF performs the argument conversion into
> the place holders, including applying what ever quoting is required.
> YOUR version is using the Python formatting operator, which does NOT
> handle database quoting.
oh, your correct.
sorry for the noise.
now it works quite good.
bye
jonas
More information about the Python-list
mailing list