Jump to content

PHP Search


scrubbicus

Recommended Posts

I do it like this:

 

$trimmed = trim($_GET['q']);
$query = "SELECT *,code,name,
MATCH(code) AGAINST ('$trimmed' IN BOOLEAN mode) AS score1,
MATCH(name) AGAINST ('$trimmed' IN BOOLEAN mode) AS score2
FROM snippets 
WHERE  
MATCH(code,name) AGAINST ('$trimmed' IN BOOLEAN mode) ORDER BY score1 DESC, score2 DESC";

Link to comment
https://forums.phpfreaks.com/topic/147877-php-search/#findComment-776153
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.