title: database search question PHP
body: <p>my code is this,</p>
  
  <pre><code>$query = "SELECT * FROM  `cars` WHERE  (color LIKE '%". $key ."%' OR name LIKE '%". $key ."%') AND enabled = 'yes'  ORDER BY  `ID`";
  </code></pre>
  
  <p>database is like this</p>
  
  <pre><code>ID     color       name        enabled
  ----  ------     --------     ---------
  1       red        red car       yes
  2      blue        blue car      yes
  3       brown      brown car     yes
  </code></pre>
  
  <p>r</p>
  
  <p>when i search with the key "red" it returns first field (ID 1) but if i search with "red car" it returns nothing.</p>
  
  <p>how can i search both 2 field ?</p>
  
  <p>thanks</p>
  
  <p>EDIT: i fixed brackets but still i cant get results with more than 1 word keys.</p>
  
  <p>Tried this with no luck</p>
  
  <pre><code>  $query = "SELECT * FROM  `cars` WHERE  (MATCH (color,name) AGAINST ('$key' IN BOOLEAN MODE)) AND enabled = 'yes'  ORDER BY  `ID`";
  </code></pre>
  
  <p>EDIT 2: Peter is right. There is no problen in query. weird thing is 
          i use this </p>
  
  <pre><code>$key = $_GET['key'];
  </code></pre>
  
  <p>if $_GET['key'] is more than 1 word, $key is returns empty for a reason.</p>