Using Fulltext queries [SOLVED]
Posted: Thu Oct 04, 2007 10:49 am
Hi,
I'm using the following code to return any records found matching a search input via the variables $varText.
My problem is, it keeps displaying my error "Nothing found, sorry!". I enter in search words that i know exist in the table and still the error message persists.
P.s. the table column 'strText' is defined as "Fulltext" in the database.
Any ideas?
I'm using the following code to return any records found matching a search input via the variables $varText.
Code: Select all
include"connection_to_db.php";
if(isset($_POST['submit']))
{
$varText=$_POST['text'];
$query=mysql_query("SELECT * FROM tblFullText
WHERE MATCH (strText) AGAINST ('$varText')");
if(mysql_num_rows($query)==0)
{
echo'Nothing found, sorry!';
}
else
{
while($row=mysql_fetch_array($query))
{
echo $row['strText'];
}
}
}P.s. the table column 'strText' is defined as "Fulltext" in the database.
Any ideas?