title: Can I use the same cursor while looping through it?
body: <p>I am iterating through a <code>SELECT</code> result, like this:</p>
  <pre><code>import MySQLdb
  
  conn = MySQLdb.connect(host = 127.0.0.1, user = ...) # and so on
  cur = conn.cursor()
  
  cur.execute(&quot;SELECT * FROM some_table&quot;)
  
  for row in cur:
      # some stuff I'm doing
      # sometimes I need to perform another SELECT here
  </code></pre>
  <p>The question is, can I use <code>cur</code> again inside the <code>for</code> loop, or do I have to create another cursor (or even more - another connection)?</p>
  <p>I guess I am missing some basic knowledge about databases or Python here... I am actually quite new with both. Also, my attempts to google the answer have failed.</p>
  <p>I would even guess myself that <em>I have to create another cursor</em>, but I think I have actually used it for some time like this before I realized that it might be wrong and it seemed to work. But I am a bit confused now and can't guarantee it. So I just want to make sure.</p>