Never build SQL by gluing user input into a string. An attacker can type SQL into a form field and run it. Use parameters and let the driver handle the values.
import sqlite3 conn = sqlite3.connect("shop.db") name = input("Search: ") # WRONG: conn.execute(f"SELECT * FROM products WHERE name = '{name}'") rows = conn.execute("SELECT * FROM products WHERE name = ?", (name,)).fetchall() print(rows)