title: applying preg_match on mysql
body: <p>If db_table with set of urls</p>
  
  <pre><code>1,www.something.any/djjjj
  2,www.anything.any/nsmms
  3,www.google.com
  </code></pre>
  
  <p>etc</p>
  
  <p>and i want filter some certain url of exact prefix which is something.any
  with help i've got answer say this</p>
  
  <pre><code>if (preg_match('/something.com/i', $url) &gt; 0) {
      // Your error message here
  }
  </code></pre>
  
  <p><strong>The question</strong></p>
  
  <p>How to apply same idea of <code>preg_match</code> to delete all of it from db_table</p>
  
  <pre><code>$sql= "delete from urls where preg_match('/something.com/i', $url) &gt; 0";
  mysql_query($sql) or die("query failed: $sql".mysql_error()); 
  </code></pre>
  
  <p>it gives indeed error but that is the exact idea i want to apply so any idea ! </p>
  
  <p>as i'm gonna makes connection to db then call all urls in my table then apply it to delete all urls added with that exact prefix <code>something.com</code> and that is it.</p>