title: Python MySQLdb returning variable amount of rows on same call
body: <p>I'm working on a project but I'm kinda stuck due to a weird problem. I pull data from an external API and save it into my own SQL database with a Python script. After pulling the data I check if it's already present in my database. I do this with the following code snippet:</p>
  
  <pre><code>def getDatabaseMatchesForSummoner(summonerId):
      sqlSelect = 'SELECT gameId FROM playerMatchHistory WHERE playerId=%s'
      try:
          cur.execute(sqlSelect,(summonerId,))
          db.commit()
      except MySQLdb as e:
          db.rollback()
          print e
      gameIds = []
      print cur.rowcount
      for i in range(cur.rowcount):
          gameIds += [str(cur.fetchone()[0])]
      return gameIds
  </code></pre>
  
  <p>Now the problem is the following: this piece of code tends to return an amount of rows that are not in agreement with my actual database. For instance, for a particular summoner ID, it returns 7 rows whereas if I enter the query into phpMyAdmin I get 10, the correct amount. I've been searching for some hours now and I can't honestly find anything wrong with it. I tried some other things like fetchall(), other string formatting, etc. I really hope someone can point out what's wrong.</p>