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

Boudewijn Rempt boud at rempt.xs4all.nl
Tue Mar 7 13:59:22 EST 2000


Miles Thompson <milesthompson at sprint.ca> 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  | http://www.valdyas.org



More information about the Python-list mailing list