fork(2) download
  1. <?php
  2. $search = "tes hello hey wha";
  3. $search_exploded = explode(" ", $search);
  4.  
  5. $construct = "SELECT * FROM Leads WHERE keywords LIKE ";
  6. $construct .= "'%".implode("%' AND '%", $search_exploded)."%'";
  7.  
  8. print $construct;
  9.  
  10.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
SELECT * FROM Leads WHERE keywords LIKE '%tes%' AND '%hello%' AND '%hey%' AND '%wha%'