title: php mysql select like not working
body: <p>I am trying to query a mysql table using some "likes". But it doesn't work at all.</p>
  
  <p>This is my code:</p>
  
  <pre><code> $color_base1 = $row[color_base1];
  $color_base2 = $row[color_base2];
  
  $result2 = mysql_query("SELECT * FROM item_descr WHERE (color_base1 LIKE 
             '%$color_base1%' OR color_base2 LIKE '%$color_base1%' OR color_base1 
             LIKE '%$color_base2%' OR color_base2 LIKE '%$color_base2%') 
             AND id_item != $itemId");
  
  if (mysql_fetch_array($result2) == 0)
  {
       $result2 = mysql_query("SELECT * FROM item_descr WHERE (keywords LIKE 
                  '%$keywords%') AND id_item != $itemId LIMIT 3");
  }
  else 
  {
      $row2 = mysql_fetch_array($result2);
      echo "&lt;div class='similarTitle'&gt;YOU MAY ALSO LIKE&lt;/div&gt;";
      while ($row2 = mysql_fetch_array($result2))
      {
         echo "&lt;div class='similarItems'&gt;";
         echo "&lt;img class='similarImage' src='images/{$row2[thumb1]}.jpg'&gt;";
         echo "&lt;div class='similarItemsText'&gt;".$row2[name]."&lt;/div&gt;&lt;/div&gt;";
      }
  }
  </code></pre>
  
  <p>Thanks!</p>