[Solved] How to get search result by a keyword from different table in MySQL for php? [closed]


Maybe something like this?

SELECT p.title, p.model_no,
    b.brand_name,
    c.category_title,
    s.specification_title
FROM tbl_product AS p
    LEFT JOIN tbl_brand AS b ON b.id = p.brand_id
    LEFT JOIN tbl_category AS c ON c.id = p.category_id
    LEFT JOIN tbl_product_specification AS s ON s.product_id = p.id
WHERE p.title LIKE 'keyword'
    OR p.model_no LIKE 'keyword'
    OR b.brand_name LIKE 'keyword'
    OR c.category_title LIKE 'keyword'
    OR s.specification_title LIKE 'keyword'

1

solved How to get search result by a keyword from different table in MySQL for php? [closed]