title: use PHP variable in MySQL REGEXP
body: <p>I have multiple ids separated by <code>+</code> in one field of a row in a table
  Like : (<strong>123</strong>+21654+412+12387)</p>
  
  <p>I need Only EXACT MATCHES, (e.g.: only "123" and not "123 &amp; 12387")</p>
  
  <p>My code is like this:<br></p>
  
  <pre><code>$var = $value['id'];
  $result = mysqli_query($this-&gt;dbh, "SELECT id FROM table
        WHERE id REGEXP '[[:&lt;:]]$var[[:&gt;:]]' ");
  </code></pre>
  
  <p>I have a problem with using a variable in REGEXP.</p>
  
  <p>in case of :</p>
  
  <pre><code>$result = mysqli_query($this-&gt;dbh, "Select id FROM table
        WHERE id REGEXP '^$id|[\+]$id' ");
  </code></pre>
  
  <p>it works, but it does not return only exact matches</p>