Hi,
Im trying to create a php search function that will query a mysql db but with boolean "And" "or" "And NOT" functionality. Is this possible?
Using the code below, I am able to bring up data that is searched for by creating a FULLTEXT index for the required fields but I dont know how to limit that data e.g. where the user wants criteria a and b or a and not b:
$result = mysql_query("SELECT a, b,c,d,e,f FROM table WHERE match(a, b,c,d,e,f) against ('%$search%')");
if (!$result) {
die('<p>Error performing query: ' . mysql_error() .
'</p>');
}
while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) {
echo('
<p>' . $row["a"] . '</p>
<p>' . $row['b'] . '</p>
<p>' . $row['c'] . '</p>
<p>' . $row['d'] . '</p>
<p>--------------------------</p>
');
}