Menu

problem with fetch_row

Help
2006-02-09
2012-09-19
  • Cracked Mind

    Cracked Mind - 2006-02-09

    db = _mysql.connect (...)
    db.query(...)
    res = db.store_result()
    a = res.fetch_row(maxrows = 1, how = 1) #in the documentation said that how = 1 return row as is dictionary
    print a['id'] # TypeError: tuple indices must be integers

    Maybe i don't understand something?

     
    • Andy Dustman

      Andy Dustman - 2006-02-09

      Yeah. Start by reading PEP-249. Then read all of MySQLdb.txt from the documentation. If you're using _mysql, you didn't read far enough.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.