Yes, I realize that it is SQLite that interprets the query but how you code it in Python seems to be different than what I am used to. For example, I initially coded a search query like this:
I simply want to be able to find the proper record even if the user has a typo in the dinosaur name entered in the search box. For example, Correct spelling = Trilobite, but user could enter Trilobyte or maybe Trylobite.
c.execute('SELECT * FROM dino WHERE name = dinoName’)But that wouldn’t work and later I was told that I had to code it like this:
c.execute('SELECT * FROM dino WHERE name = :dinoName',{'dinoName': dinoName})That worked as far as retrieving a record where the name equals the search string but for the LIKE statement it doesn’t work.
c.execute('SELECT * FROM dino WHERE name LIKE :dinoName',{'dinoName': dinoName})I also tried this:
c.execute('SELECT * FROM dino WHERE name LIKE dinoName’)And also this:
c.execute('SELECT * FROM dino WHERE name LIKE %’ + dinoName + %’)And this:
c.execute('SELECT * FROM dino WHERE name LIKE %dinoName%’)They don’t work either.
I simply want to be able to find the proper record even if the user has a typo in the dinosaur name entered in the search box. For example, Correct spelling = Trilobite, but user could enter Trilobyte or maybe Trylobite.