Right now i'm building a custom query using php and mySql. Say I've a string Hello this is me. For this
select distinct(user_primary.id) as id
from user_primary,
user_sec,
user_location,
user_ind_cat
where
(
user_primary.status != 3
and
(
user_primary.id = user_sec.job_id
)
and
(
user_primary.id = user_ind_cat.job_id
)
)
and
(
(
user_primary.name like "%Hello%"
)
or
(
user_primary.name like "%this%"
)
or
(
user_primary.name like "%is%"
)
or
(
user_primary.name like "%me%"
)
and
(
user_primary.name like "%Hello this is me%"
)
)
and
(
user_primary.login <= 1415426357
)
limit 0, 150
So far it was working fine until recently I've found a issue. Whenever I ran this kind of query it generates results contains user's with full name like the search token and other matching tokens generated from search token. But the actual row which has perfect match with provided token "Hello this is me" is not showing in top.
Let me explain the results if i ran current query,
- "Hello how are you"
- "this is nixon"
- "Hello this is me"
- "oh hello there"
- "I'm me"
- "hello you there"
I want to show the actual result in the top, so the results will be look like this,
- "Hello this is me"
- "Hello how are you"
- "this is nixon"
- "oh hello there"
- "I'm me"
- "hello you there"
Can anyone please tell me what's the problem here? Or should I remove or add the query?
Thanks in advance,
Nixon