title: Gets results only when empty
body: <p>I have this sql statement that returns rows from a customer table.  The user has the option for searching with what ever they want to type in.  I had this working, until I tried to protect against sql injecting by using bindValue.  Now I can't get any results to return unless the user leaves the textbox blank.  Below is my code.  </p>
  
  <p><strong>Model</strong><br /></p>
  
  <pre><code>function searchMyCusts($field, $query){          
      $data = null;
      $msg = null;
      $status = null;
  
      $sth = $this-&gt;db-&gt;prepare("SELECT ".CustomerFields::ID.",".CustomerFields::FirstName.",".CustomerFields::LastName.",".CustomerFields::PhoneNumber." FROM ".CustomerFields::TableName." WHERE '$field' LIKE :query");
  
      $sth-&gt;bindValue(':query', $query);
  
      if ($sth-&gt;execute()){
          $status = "success";
          $msg = "Customer entry successfully altered";            
          $data = $this-&gt;smartFetchAll($sth);
  
  
      }else{
          $status = "error";            
          $msg = "An error occurred. :".$sth-&gt;errorInfo()[2];
      }
  
      $jsonData = json_encode($this-&gt;buildResponseArray($status, $msg, $data));        
      return $jsonData;
  }
  </code></pre>
  
  <p>In the prepare line at the end I have the values being passed in.  Like I said this was working until I attempted to bindValue the query variable.  </p>
  
  <p>I would appreciate any insight you may have.  Thanks in advance!</p>
  
  <p>Regards</p>