06-04-2010, 12:30 PM
|
#4 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 107
Thanks: 3
|
Hmm, thank you. How about this >
PHP Code:
SELECT *, ((CASE WHEN `description` LIKE '%brown%' THEN 1 ELSE 0 END) + (CASE WHEN `description` LIKE '%fox%' THEN 1 ELSE 0 END) + (CASE WHEN `description` LIKE '%lazy%' THEN 1 ELSE 0 END) + (CASE WHEN `description` LIKE '%dog%' THEN 1 ELSE 0 END)) AS relevance FROM `items` WHERE `description`LIKE '%quick%' AND ( `description`LIKE '%brown%' OR `description` LIKE '%fox%' OR `description` LIKE '%lazy%' OR `description` LIKE '%dog%' ) ORDER BY relevance DESC LIMIT 0 , 30;
Do you think that works properly ? Or what money you want to do the best script for that ?
Last edited by CΛSTΞX : 06-04-2010 at 02:51 PM.
|
|
|