title: Trying to check if value already in MySQL DB
body: <p>I am writing a script that will run every 20 minutes that looks for files to download but I want to check if I have already dowloaded the file:
  First my code executes this command:</p>
  
  <pre><code>cursor.execute("SELECT `file_id` FROM `reports`")
  file_ids = list(cursor.fetchall())
  </code></pre>
  
  <p>file_ids is a longer version of this:</p>
  
  <pre><code>[('735724',), ('734791',), ('735934',), ('735486',)]
  </code></pre>
  
  <p>I wrote this function to check if I had already downloaded the file:</p>
  
  <pre><code>def new_file(file):
      file = "('%s',)" % (file)
      if (file in file_ids):
          print "true"
      else:
          print "false"   
  </code></pre>
  
  <p>When I try to to test the function:</p>
  
  <pre><code>file = "735724"
  new_file(file)
  </code></pre>
  
  <p>It prints false consistently.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>I know that I could run a MySQL statement for each fileid to see if I have the file already but since there are thousands of files to check I assumed doing this would be faster.  If I am wrong on that please feel free to correct me.</p>