I am trying to set up my search bar to create a table of results when searching through two tables.
Each table (fresh, salt) has 2 columns (ID and DESCRIPTION).
if(isset($_REQUEST["term"])){
// Prepare a select statement
$term = $_REQUEST['term'];
$sql = "SELECT * FROM fresh WHERE
description LIKE '%{$term}%' or
sku like '%{$term}%'
union
SELECT * FROM marine WHERE
description LIKE '%{$term}%' or
sku like '%{$term}%'";
if($stmt = mysqli_prepare($link, $sql)){
// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param($stmt, "s", $param_term);
// Set parameters
$param_term = $_REQUEST["term"] . '%';
Searched terms can be anything like, "Neon Tetra", but the search currently looks for that string as is and I'd like for it to search as two+ different keywords separated by space, even if terms are backward such as "Tetra Neon".