
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.75 KB | hits: 15 | expires: Never
FULLTEXT mysql search not working
$query=mysql_query("SELECT * FROM comments WHERE MATCH (comments) AGAINST ('%$user_text%')");
while ($row=mysql_fetch_assoc($query)){
echo "<div>$row['comment']</div>";
}
CREATE TABLE `comments` (
`id` int(11) NOT NULL...
PRIMARY KEY (`id`), //these are the last 3 lines
FULLTEXT KEY `comments` (`comment`)
) ENGINE=MyISAM AUTO_INCREMENT=93 DEFAULT CHARSET=latin1
SELECT * FROM comments WHERE MATCH (comments) AGAINST ('$user_text*' IN BOOLEAN MODE)"
SHOW CREATE TABLE comments;
"SELECT * FROM comments WHERE MATCH (questiontitle) AGAINST ('$user_text')"
"SELECT * FROM comments WHERE MATCH (questiontitle) AGAINST ('$user_text' WITH QUERY)" EXPANSION
($row=mysql_fetch_assoc($query)