I have a database table with several columns:
Category Model Manufacturer
Roland Pianos | HP605 | Roland
Kawai Pianos | CL36 | Kawai
Roland Keyboards | BK9 | Roland
I want to be able to search both columns at the same time so when I put in the search bar Roland HP605 I want the result to show the Roland HP605.
At the moment I've got the following: Search Box:
<input id="search" name="Search" type="text" placeholder="Search Products">
Search Code:
if (isset($_GET['Search'])) {
$query_RS_Search ="SELECT * FROM products WHERE Category LIKE :search OR products.Manufacturer LIKE :search OR products.Model LIKE :search";
$RS_Search = $conn->prepare($query_RS_Search) or die(errorInfo());
$RS_Search->BindValue(':search', '%'.$_GET['Search'].'%');
$RS_Search->execute();
$row_RS_Search = $RS_Search->fetch();
Which works fine if you put in the search bar "Roland" All Roland products come up both piano and keyboard, however if I search for "Roland HP605" it will not be able to find it.
Any help welcome