Python/MySQL Where do "SELECT ..." results go?

Boudewijn Rempt boud at
Tue Mar 7 19:59:22 CET 2000

Miles Thompson <milesthompson at> wrote:

>>>> import Mysqldb

Where did you get this? I know of MySQLdb and MySQL (and mySQL)
as Python modules, but I haven't heard of Mysqldb before. If you
were using MySQLdb, you would be using the DB-API II api, which
ought to be portable to other databases (but are there any other 
database modules that conform to this api?)

>>> import MySQLdb
>>> conn=MySQLdb.connect(host='localhost',user='boud',db='lng',passwd='')
>>> curs=conn.cursor()
>>> curs.execute('select * from lng_parameter');
>>> print curs.fetchall()
[('testvalue', 'TEST')]

So, judging from your output, I'd try a curs.fetchall(), too.


Boudewijn Rempt  |

More information about the Python-list mailing list