title: PHP PDO - Invalid parameter number: parameter was not defined when using RLIKE
body: <p>I have a simple MySQL table with a <code>text</code> field.</p>
  
  <p>I can do this search direct in MySQL to search for an exact phrase (I don't want to use a full text index hence this approach):</p>
  
  <pre><code>select * from tbl_log_days where post_content RLIKE '[[:&lt;:]]the office[[:&gt;:]]'
  </code></pre>
  
  <p>That works fine in MySQL, and returns any text containing that exact phrase.</p>
  
  <p>I'd like to include the same in a search form using PHP.</p>
  
  <p>I have my parameterized query set up in PHP:</p>
  
  <pre><code>$sql = "SELECT ID
               , post_date
               , post_content
               , post_cat_id
               , post_label
            FROM tbl_log_days
           WHERE post_content RLIKE '[[:&lt;:]]:exact_text[[:&gt;:]]'
        ORDER BY post_date";
  
  $stmt = $pdo-&gt;prepare($sql);
  $stmt-&gt;bindParam(':exact_text', $str);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>However, when I run this, it error with:</p>
  
  <pre><code>Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in C:\data\php\public_html\diary\search.php:424
  </code></pre>
  
  <p>If I change the SQL to:</p>
  
  <pre><code>$sql = "SELECT ID
               , post_date
               , post_content
               , post_cat_id
               , post_label
            FROM tbl_log_days
           WHERE AND post_content = :exact_text '
        ORDER BY post_date";
  </code></pre>
  
  <p>It works fine.</p>
  
  <p>The problem appears to be related to the <code>'[[:&lt;:]]:exact_text[[:&gt;:]]'</code> syntax used with RLIKE.</p>
  
  <p>Is there any way I can escape the special characters in RLIKE?</p>