I found this script on the internet that I am trying to get to work. It is supposed to search resumes using "ANY" "ALL" or "NONE" keywords as specified by user. I cannot get past this error after several days of trying manuals etc. Help is sincerely appreciated: The error is "You have an error in your SQL syntax near ''','rad' IN BOOLEAN MODE) AS score FROM applicants WHERE MATCH' at line 3
SELECT *, MATCH (RESUME) AGAINST ('','','rad' IN BOOLEAN MODE) AS score FROM applicants WHERE MATCH(resume) AGAINST ('','','rad' IN BOOLEAN MODE)"
Here is the code:
<?php
/ call this script "advs.php" /
if(!$c) {
?>
<form action="advs.php?c=1" method=POST>
<b>Find Results with: </b><br>
Any of these words: <input type="text" length=40 name="any"> <br>
All of these words: <input type="text" length=40 name="all"> <br>
None of these words: <input type="text" length=40 name="none"> <br>
<input type="submit" value="Search">
</form>
<?
} else if($c) {
mysql_connect("xxx","xxx","xxx");
mysql_select_db("xxx");
if((!$all) || ($all == "")) { $all = ""; } else { $all = "+(".$all.")"; }
if((!$any) || ($any == "")) { $any = ""; }
if((!$none) || ($none == "")) { $none = ""; } else { $none = "-(".$none.")"; }
$query = "
SELECT ,
MATCH (RESUME) AGAINST ('$all','$none','$any' IN BOOLEAN MODE) AS score
FROM applicants
WHERE MATCH(resume) AGAINST ('$all','$none','$any' IN BOOLEAN MODE)";
$artm1 = MySQL_query($query);
if(!$artm1) {
echo MySQL_error()."<br>$query<br>";
}
echo "<b>Article Matches</b><br>";
if(MySQL_num_rows($artm1) > 0) {
echo "<table>";
echo "<tr><td>Score </td><td>fname </td><td>Body</td></tr>";
while($artm2 = MySQL_fetch_array($artm1)) {
$val = round($artm2['score'], 3);
$val = $val100;
echo "<tr><td>$val</td>";
echo "<td>{$artm2['fname']}</td>";
echo "<td>{$artm2['lname']}</td></tr>";
}
echo "</table>";
}
else {
echo "No Results were found in this category.<br>";
}
echo "<br>";
}