I'm coding a search function using full-text-search
and I want result to be shown only if the words typed are contained in table.
$search_value = $db->mysqli->real_escape_string("lana born to die sdkjfhsdkjfhdsjkfhdsjkfhd");
$query = "select * from `music` where match(`title`, `artist`) against ('$search_value')";
artist title
----------------------------------
lana del rey west coast
lana del rey born to die
lana del rey summertime sadness
lana del rey blue jeans
For ex. if I search: lana born to die sdkjfhsdkjfhdsjkfhdsjkfhd
it shows me lana del rey born to die
as a result. This should not happen.
I want it to show results only if you type for ex. lana
, lana del rey born
and so on.
Any ideas.