BOOLEAN full text search [help please]
Posted: Tue Jan 17, 2006 5:25 am
I am trying to set up a full text search. All is working fine but I am getting the error message:
You have an error in your SQL syntax near 'BOOLEAN MODE) AS relevance FROM dload2_categories WHERE MATCH(name, text) AGAINS' at line 1
I have looked at the code and the tutorial I am trying to follow and cannot see the problem.
Here is the code. Please help and Thanks in advance.
You have an error in your SQL syntax near 'BOOLEAN MODE) AS relevance FROM dload2_categories WHERE MATCH(name, text) AGAINS' at line 1
I have looked at the code and the tutorial I am trying to follow and cannot see the problem.
Here is the code. Please help and Thanks in advance.
Code: Select all
$search = mysql_real_escape_string($_GET['search']);
mysql_select_db($database_db_connect, $db_connect);
$query_category = "SELECT *, MATCH(name, text) AGAINST ('$search' IN BOOLEAN MODE) AS relevance FROM dload2_categories WHERE MATCH(name, text) AGAINST ('$search' IN BOOLEAN MODE) AND deleted = 'N' ORDER BY relevance DESC";
$category = mysql_query($query_category, $db_connect) or die(mysql_error());
$row_category = mysql_fetch_assoc($category);
$totalRows_category = mysql_num_rows($category);
mysql_select_db($database_db_connect, $db_connect);
$query_files = "SELECT *, MATCH(filename, name) AGAINST ('$search' IN BOOLEAN MODE) AS relevance FROM dload2_files WHERE MATCH(filename, name) AGAINST ('$search' IN BOOLEAN MODE) ORDER BY relevance DESC";
$files = mysql_query($query_files, $db_connect) or die(mysql_error());
$row_files = mysql_fetch_assoc($files);
$totalRows_files = mysql_num_rows($files);