so i am just learning the full-text searching capabilities, because i want to switch my current search engine over to it, for fairly obvious reasons
below is the current test code im using to try and get a handle on what the full-text searching is like. now i have a form on another page that passes 'criteria' to this page. i set $userinput to this criteria and then search according to this specified criteria. the problem im having is that when i try and echo anything from the results, the page just displays empty. my query echos properly, or at least it looks right to me. here is what my query echos as if i use the word "test" for my userinput:
"SELECT *, MATCH(name, city, description, website, grouping, altGrouping) AGAINST('test') AS score FROM houses WHERE MATCH(name, city, description, website, grouping, altGrouping) AGAINST('test') ORDER BY score DESC"
my code is below, and any help would be appreciated.
<?
include("other.inc");
$connection = mysql_connect($host,$user,$password) or die ("couldn’t connect to server");
$db = mysql_select_db($database,$connection) or die ("Couldn’t select database.");
$userinput = "{$_POST['criteria']}";
$query = "SELECT *, MATCH(name, city, description, website, grouping, altGrouping) AGAINST('$userinput') AS score FROM houses
WHERE MATCH(name, city, description, website, grouping, altGrouping) AGAINST('$userinput') ORDER BY score DESC";
$result = mysql_query($query) or die (mysql_error($connection));
//echo "$query";
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
extract($row);
echo "$name";
}
?>