Heres what I got so far, this script works, but it is also showing results that have nothing to do with the search keyword. This script first breaks the search into seperate words, searches each word individually, and then makes sure it only shows each result once by keeping track of the id's used. Any idea why it is also showing results that have nothing to do with the search?
for ($i = 0; $i <= count($keyword); $i++) {
$query1 = mysql_query("SELECT id,title FROM publications_student_handbook WHERE title LIKE '%$keyword[$i]%' OR publication LIKE '%$keyword[$i]%'") or die(mysql_error());
while(list($id,$title,$publication) = mysql_fetch_row($query1)) {
for ($z = 0; $z <= count($used1_ids); $z++) {
if ($used_ids1[$z] == $id) {
$id_is_used = "yes";
}
}
if ($id_is_used != "yes") {
$used_ids1[] = $id;
$title = ereg_replace(":codeapostrephy:","'",$title);
$title = ereg_replace(":codequotation:","\"",$title);
echo "<a href=\"publications.php?cmd=student_handbook&keyword=" . $keyword[$i]. "&pubid=" . $id . "\">" . $title . "</a><br>\n";
}
}
}