I am trying to build a simple PHP search to query my MySQL database. However, it only works part of the time. I am not really familiar with how to build a search. I built my code from the ideas of a book I bought a while back. Here is my code:
Code: Select all
$sql = "SELECT *, MATCH (name, full_desc, short_desc, address) AGAINST ('" . $_GET['keywords'] . "') AS score " .
"FROM activity WHERE MATCH (name, full_desc, short_desc, address) AGAINST ('" . $_GET['keywords'] . "') " .
"ORDER BY score DESC";
$result = mysql_query($sql, $conn) or die("Could not preform search: " . mysql_error());
My search will work on some, while it won't work on others. My index covers the four fields: name, full_desc, short_desc, address. What am I doing wrong here? What can I do to make my search work properly and better overall?
Thanks guys!
lwr