Jump to content

full text search


woodplease

Recommended Posts

hey,

 

i'm having an sql syntax error message display when trying to search my database.

 

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MATCH ('entry_text') AGAINST ('ancient')' at line 1"

 

'ancient' is the value being held in $search_string

 

the code that i'm using is

<?php
if (isset($_POST['search_string'])){

$search_string = mysql_real_escape_string($_POST['search_string']);
}
?>
<form name="wikisearch" method="post" action="test.php">
   		<input type="text" name="search_string" size="40"  />
   		<input type="submit" name="search" value="Search" />
  		</form>
<?php
if (isset($_POST['search_string'])){
$res = mysql_query("SELECT * FROM entry MATCH ('entry_text') AGAINST ('$search_string')")or die (mysql_error());
$ant = mysql_num_rows($res);
echo "results: ".$ant;
}
?>

 

ANy ideas whats wrong

Link to comment
https://forums.phpfreaks.com/topic/257373-full-text-search/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.