MySQL Forums
Forum List  »  PHP

fulltext keyword search returning no results
Posted by: Joanna K
Date: December 27, 2009 09:41AM

Hey all,

I've indexed the columns in my database that go with the query below, but I continue to get no results. There's no error, but the query does not produce results when I test it. Is the syntax in the query incorrect? Thanks for your help.

J

- -

<?php
include 'config.php';
include 'opendb.php';

$keyword = $_POST['keyword'];

$query = "SELECT * FROM Composer_Info WHERE MATCH(compFirst, compLast, compNumber, compEmail, pubCoAff, whereEmployed) AGAINST('$keyword')";
$result = mysql_query($query) or die(mysql_error());
$totalComposers = mysql_num_rows($result);
$counter = 1;


echo "<center>
	<table width='55%' cellpadding=0 cellspacing=6 border=0 class=style5>
	<tr><td>Total composers: ".$totalComposers."</td></tr></table>
	<table width='55%' cellpadding=3 cellspacing=2 border=1 class=style5>
	<tr>
	<td class=style4>Composer</td>
	<td class=style4>Composer Number</td>
	</tr>";

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{	
		$_SESSION['compLast'] = $row['compLast'];
		$_SESSION['compFirst'] = $row['compFirst'];
		$_SESSION['composerid'] = $row['composerid'];
		if ($counter % 2)
		{
			echo "<tr bgcolor='#AFBD22'><td>";	
		}
		else
		{
			echo "<tr bgcolor='#B1BE52'><td>";	
		}
		echo "<a href='composer_info.php?title=".$_SESSION['composerid']."' class='style6' target='_new'>".$_SESSION['compFirst']." ".$_SESSION['compLast']."</a></td><td>";
		echo $row['compNumber'];
		echo "</td></tr>";		
		$counter++;
}

echo "</table></center>";

include 'closedb.php';

?>

Options: ReplyQuote


Subject
Written By
Posted
fulltext keyword search returning no results
December 27, 2009 09:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.