title: Iterating over resultset with comparison of column name - in python with Mysqldb
body: <p>i want to use python to populate a database. I have to get values out of a table, calculate a score and fill this score into anoter table. I cant figure out how i can compare the column names of a row from a resultset. Because i dont need all of the columns to calculate, but need a few others as id and type_name for none calculation. So basically i want to do this:</p>
  
  <pre><code>cur = connection.cursor()
  QUERY ="SELECT * FROM table"
  cur.execute(QUERY)
  rs = cur.fetchall()
  for row in rs:
      for col in row:
          // if(col = "X" or col = "Y" or col = "Z"):
                 calc ...
          // else:
                 use id, type_name whatever ...
  </code></pre>
  
  <p>how can achieve something like this? Else the code would just blow up like a bomb.</p>