Im trying to create a search for a product from the database.
MY DB:
tbl_brand
-----------
brand_id Brand_name
1 Canon
2 Nikon
tbl_product
-------------
prod_id prod_name brand_id
1 Canon PowerShot A810 16MP Point & Shoot Digital Camera 1
2 Canon Digital Camera PowerShot 8MP Point & Shoot 1
3 PowerShot 8MP Point & Shoot Digital Camera 1
4 PowerShot 8MP Point & Shoot Digital 1
My Keyword for search :
$keyword = 'Camera';
$keyword = 'Digital Camera';
$keyword = 'Canon Digital Camera';
$keyword = 'Canon Camera';
my query
Select * from tbl_product where prod_name like '%$keyword%'
I get results for first three keywords. But for 4th keyword i get results empty.
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.
I need to show all the products for 'Canon Camera' keyword . I am newbie for php and mysql. Kindly help in this.