I am in the process of updating a website that was created a previous admin. Most of it is outdated php code however there is too much to change so I am working with what I have.
I am trying to run a search query as follows;
$term = trim($_REQUEST['term']);
$searchterm = mysql_real_escape_string($term, $link); //link to db
$sql = "SELECT DISTINCT party_id
FROM vw_ft_search WHERE
MATCH (party_name)
AGAINST ('+$searchterm' IN BOOLEAN MODE)";
This always throws the error below;
MySQL Error 1210 : Incorrect arguments to AGAINST
I have read the instructions here which advises using a literal string (which I think I am?). When I echo out the $searchterm
it shows the correct search term ('Charles' in this case.)
I have also tried to run the query with a manual string entered as follows, however same result;
$sql = "SELECT DISTINCT party_id
FROM vw_ft_search WHERE
MATCH (party_name)
AGAINST ('%Charles%' IN BOOLEAN MODE)";
Is it something to do with the query, view, variable?
Any direction is appreciated. Quite new to php/mysql.