Jeroen Ruigrok van der Werven wrote:
cursor=db.cursor()
cursor.execute(sql)
while (1):
row = cursor.fetchone()
if row == None:
break
combined = ', '.join(row)
Why not something like:
for row in cursor.fetchall():
combined = ', '.join(row)
which can be written as
combined = ', '.join(cursor.fetchall())
but probably won't work, since fetchall() returns a sequence of tuples,
unless I'm mistaken. Try something like this instead:
combined = ', '.join(row[0] for row in cursor.fetchall())
</F>
--
http://mail.python.org/mailman/listinfo/python-list