cursor.execute("select id, name from table")
rows = cursor.fetchall()
for row in rows:
print row.id, row.need_fetch
AttributeError: 'tuple' object has no attribute 'id'
求教V2EX高手,如何按照列名来访问不要row[0]这种方式
rows = cursor.fetchall()
for row in rows:
print row.id, row.need_fetch
AttributeError: 'tuple' object has no attribute 'id'
求教V2EX高手,如何按照列名来访问不要row[0]这种方式