View Single Post
Old 06-04-2010, 12:30 PM   #4 (permalink)
CΛSTΞX
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Hmm, thank you. How about this >

PHP Code:
SELECT *, ((CASE WHEN `descriptionLIKE '%brown%' THEN 1 ELSE 0 END) + (CASE WHEN `descriptionLIKE '%fox%' THEN 1 ELSE 0 END) + (CASE WHEN `descriptionLIKE '%lazy%' THEN 1 ELSE 0 END) + (CASE WHEN `descriptionLIKE '%dog%' THEN 1 ELSE 0 END)) AS relevance
FROM 
`items`
WHERE `description`LIKE '%quick%' AND (
  `
description`LIKE '%brown%'
  
OR `descriptionLIKE '%fox%'
  
OR `descriptionLIKE '%lazy%'
  
OR `descriptionLIKE '%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 ?
__________________
Downloadic
infolizer

Last edited by CΛSTΞX : 06-04-2010 at 02:51 PM.
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote