title: check if value Y in column Z in table X
body: <p>I want to write a function to check if Table X has a row with Value Y in column Z. If this condition is satisfied return True, otherwise return False.</p>
  
  <p>I write the following function:</p>
  
  <pre><code>def valueInDatabase(cursor,value,table, col):
      check = cursor.execute("""SELECT %s from %s"""%(col,table))
      result = cursor.fetchall()
      if value in result:
          return True
      else:
          return False
  </code></pre>
  
  <p>and I test my function with the following code:</p>
  
  <pre><code>conn = sqlite.connect(":memory:")
  cursor = conn.cursor()
  cursor.execute("CREATE TABLE problem1 (x int unique)""")
  cursor.executemany("INSERT INTO problem1(x) VALUES (?)",[(1,),(2,),(3,),(4,)])
  print valueInDatabase(cursor,5,'problem1','x')
  print valueInDatabase(cursor,2,'problem1','x')
  </code></pre>
  
  <p>it prints "false" and "false", but it should print "true" and "false". Anyone can help me to fix my code?</p>