Alexis Boutillier
alexis.boutillier at arteris.net
Mon Oct 11 12:29:25 EDT 2004
I try to use mod_pytohn with MySQLdb and have this problem when trying to do a select : there is my code : def handler(req): db = MySQLdb.connect(mysqlHost,mysqlUser,mysqlPasswd,mysqlDb,compress=1,cursorclass=MySQLdb.cursors.DictCursor) cur=db.cursor() t = cur.execute("SELECT TestDriverId,Title FROM TestDrivers") res = cur.fetchall() req.write(str(res)) And i got this reponse. therefore, sometimes, i got the correct answer. I also try to do a "SELECT * FROM TestDrivers" but this hand in a segfault of the child. Mod_python error: "PythonHandler form" Traceback (most recent call last): File "/soft/Python/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch File "/usr/local/apache2/python/form.py", line 34, in handler t = cur.execute("SELECT * FROM TestDrivers") File "/var/tmp/MySQL-python-buildroot/usr//lib/python/MySQLdb/cursors.py", line 95, in execute File "/var/tmp/MySQL-python-buildroot/usr//lib/python/MySQLdb/cursors.py", line 114, in _execute File "/var/tmp/MySQL-python-buildroot/usr//lib/python/MySQLdb/connections.py", line 33, in defaulterrorhandler ValueError: invalid literal for float(): test1 -- Boutillier Alexis Methodology engineer Arteris SA The Network-on-Chip Company TM www.arteris.net 6 par Ariane Immeuble Mercure 78284 Guyancourt Cedex France Office: (+33) 1 61 37 38 71 Fac: (+33) 1 61 37 38 41 Alexis.Boutillier at arteris.net
|