BOOLEAN full text search [help please]

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

BOOLEAN full text search [help please]

Post by php3ch0 »

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.

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);
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Post by php3ch0 »

{SOLVED}

I was using an old version of MYSQL
Post Reply