Gregory (Grisha) Trubetskoy
grisha at modpython.org
Mon Oct 11 11:30:56 EDT 2004
This sounds like a MySQLdb rather than a mod_python problem. Grisha On Mon, 11 Oct 2004, Alexis Boutillier wrote: > 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 > > _______________________________________________ > Mod_python mailing list > Mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python >
|