Skus funkciu passToHash() upravit takto: .... hash = hash.hexdigest() return hash
azur >-----Pôvodná správa----- >Od: [mailto:[email protected]] >Komu: Konference PyCZ <[email protected]> >Predmet: [python] hash, mysql > > >Dobrý den, mám problémy se spoluprací se sql serverem: > >server my vrací chybu: >ProgrammingError: (1064, 'You have an error in your SQL syntax; check the >manual that corresponds to your MySQL server version for the right syntax to >use near >\'\xa1A\x91k\xc7\xde\x17M\xe0j\xec\xc2\xf1(,iq|\x839;&\x17\xc4\xc1\xcc\x04\x93\x0e\xc81R\xf5UB&\xd1\xaf\xb4P"\' > at line 1') > > >při interpretaci: "SELECT * FROM users WHERE name='root' AND password=%s" % >password > >kde password je text získaný metodou: >def passToHash(self, password): >hash = hashlib.sha512() >hash.update(password) >hash = hash.digest() >return hash > >Nevíte kde dělám chybu? >_______________________________________________ >Python mailing list >[email protected] >http://www.py.cz/mailman/listinfo/python _______________________________________________ Python mailing list [email protected] http://www.py.cz/mailman/listinfo/python
