title: Python SQLite parameter substitution with wildcards in LIKE
body: <p>I am attempting to use a parametrized LIKE query with Python's Sqlite library as below:</p>
  
  <pre><code>self.cursor.execute("select string from stringtable where string like '%?%' and type = ?", (searchstr,type))
  </code></pre>
  
  <p>but the ? inside of the wildcard is not being evaluated leaving me with this error:</p>
  
  <pre><code>"sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2 supplied."
  </code></pre>
  
  <p>I also tried to use the tagged version of querying with:</p>
  
  <p><code>like '%:searchstr%'</code> and in the list having <code>{"searchstr":searchstr...</code></p>
  
  <p>but when I do that the query runs but never returns any results even though manually putting in <code>"like '%a%'"...</code> return hundreds of results as it should</p>
  
  <p>any suggestions please?</p>