Boolean search with mysql FullText search
Posted: Sat Mar 08, 2003 11:47 am
I am adding Fulltext search support to a small site and I've run into some trouble. I'm getting an in-"valid MySQL result" error. The offending code snippit is below. Essentially, I have a PHP generated HTML page that presents (among other things) a checkbox for boolean search. When the checkbox is unchecked, everything works. However, when the checkbox is selected, the following message is displayed (based on the boolean search sql statement).
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/...../public_html/.../index.php on line 376
here is the code. I've tried to search without tracking the score ($sql = "select * From news WHERE MATCH (text) AGAINST ( '$searchString' IN BOOLEAN MODE)";) and it still fails.
<snip>
if($booleanSearch)
$sql = "select *, MATCH(text) AGAINST ('$searchString' IN BOOLEAN MODE) AS score From news WHERE MATCH (text) AGAINST ('$searchString' IN BOOLEAN MODE)";
else
$sql = "select *, MATCH (text) AGAINST ('$searchString') AS score From news WHERE MATCH (text) AGAINST ('$searchString')";
<snip>
-Thanks
Mark
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/...../public_html/.../index.php on line 376
here is the code. I've tried to search without tracking the score ($sql = "select * From news WHERE MATCH (text) AGAINST ( '$searchString' IN BOOLEAN MODE)";) and it still fails.
<snip>
if($booleanSearch)
$sql = "select *, MATCH(text) AGAINST ('$searchString' IN BOOLEAN MODE) AS score From news WHERE MATCH (text) AGAINST ('$searchString' IN BOOLEAN MODE)";
else
$sql = "select *, MATCH (text) AGAINST ('$searchString') AS score From news WHERE MATCH (text) AGAINST ('$searchString')";
<snip>
-Thanks
Mark