title: Product Search php mysql
body: <p>Im trying to create a search for a product from the database. </p>
  
  <p>MY DB:</p>
  
  <pre><code>tbl_brand
  -----------
  brand_id Brand_name
  1        Canon
  2        Nikon
  
  tbl_product
  -------------
  prod_id  prod_name                                                    brand_id
  1        Canon PowerShot A810 16MP Point &amp; Shoot Digital Camera       1
  2        Canon Digital Camera PowerShot 8MP Point &amp; Shoot             1
  3        PowerShot 8MP Point &amp; Shoot Digital Camera                   1
  4        PowerShot 8MP Point &amp; Shoot Digital                          1
  </code></pre>
  
  <p>My Keyword for search : </p>
  
  <ol>
  <li><code>$keyword = 'Camera';</code></li>
  <li><code>$keyword = 'Digital Camera';</code></li>
  <li><code>$keyword = 'Canon Digital Camera';</code></li>
  <li><code>$keyword = 'Canon Camera';</code></li>
  </ol>
  
  <p>my query</p>
  
  <pre><code>Select * from tbl_product where prod_name like '%$keyword%'
  </code></pre>
  
  <p>I get results for first three keywords. But for 4th keyword i get results empty.</p>
  
  <p>Canon Camera - keyword does not match the product name. But all the products are under canon brand only and all the products are camera only.</p>
  
  <p>I need to show all the products for 'Canon Camera' keyword . I am newbie for php and mysql. Kindly help in this.</p>