I made a simple PHP search functionality, it can search for the `product_name` but I wanna add another functionality so that it will be able to search either from `product_name` **OR** `product_designer`.

**Search Function**

```
function search($dbh, $word){

$query = "SELECT
product.product_name,
product.product_color,
product.year_released,
product.product_price,
product.product_image,
product.product_id,
product.product_desc,
product.product_designer,
type.name as type
FROM
product
JOIN type USING(typpe_id)
WHERE
product.product_name LIKE :word";

$stmt = $dbh->prepare($query);

$stmt->bindValue(':word', '%'.$word.'%', PDO::PARAM_STR);

$stmt->execute();

// fetch one product
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}

```

**Function Call**

```
if(!empty($_GET['word'])) {
    $products = search($dbh, $_GET['word']);
    $title = 'Products like: ' . $_GET['word'];
}

```