How to bind a parameter inside of a LIKE clause with percentages in mysqli?
<p>I'm using <code>mysqli</code>, and I have this query:</p>

<pre><code>$q = "SELECT col1, col2 FROM `Something` WHERE col2 LIKE '%?%'";
</code></pre>

<p>The same query works fine if I query it outside of PHP with a word in place of <code>?</code>. Within PHP, I can't do this. The error I'm getting is:</p>

<blockquote>
  <p>mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement[..]</p>
</blockquote>

<p>The query is outputting fine in <code>var_dump()</code>, as is the parameter itself. </p>

<p>Here's the <code>bind_param()</code>:</p>

<pre><code>$stmt-&gt;bind_param("s", $param);
</code></pre>

<p>What am I doing wrong?</p>