views:

61

answers:

1

Query #1:


SELECT DISTINCT `title`
FROM `table`
WHERE (
`title` LIKE '%this is search%'
)
OR (
`title` LIKE '%this%'
AND `title` LIKE '%is%'
AND `title` LIKE '%search%'
)
OR (
`title` LIKE '%this%'
OR `title` LIKE '%is%'
OR `title` LIKE '%search%'
)
LIMIT 0 , 10

but not works good , and when I try splited this sql:

Query #2:


SELECT DISTINCT `title`
    FROM `table`
    WHERE (
    `title
` LIKE '%this is search%'
    )

or

Query #3:


SELECT DISTINCT `title`
    FROM `table`
    WHERE (
`title` LIKE '%this%'
    AND `title` LIKE '%is%'
    AND `title` LIKE '%search%'

or etc ...

returns different results

+2  A: 

You are providing too little information, but from what I can see, you are looking for mySQL's fulltext search functions.

Pekka