title: Execute a command if "something" is found in database
body: <p>Hello I created a database and I want to scan through it and if a specific item is found in the database then I want the user tho know the item is in and then start the loop again and ask the user to enter a different item, and only when and item that is not in the database is entered the loop should not repeat but instead of that, the program let's the user know they is an Error and then still continues on without restarting the loop. this is my code. I am using python 3 by the way.</p>
  
  <pre><code>import sqlite3
  import datetime
  from datetime import date
  
  conn = sqlite3.connect("things.db")
  c = conn.cursor()
  
  def create_table():
      c.execute("CREATE TABLE IF NOT EXISTS data(Thing TEXT, Description TEXT, Date TEXT)")
  def data_entry():
  
      while True:
  
          Thing = input("Please enter a thing you know: ").capitalize().strip()
  
          for row in c.execute("SELECT * FROM data ORDER BY Thing"):
              if Thing in row:
                  print ("Error")
              else:
                  Description = input("Now enter a description of this thing: ").strip()
                  Date = date.today()
  
      c.execute("INSERT INTO data (Thing, Description, Date) VALUES (?, ?, ?)", (Thing, Description, Date))
      conn.commit()
      c.close()
      conn.close()
  
  
  data_entry()
  </code></pre>