We are having a few problems with our search results on web site.
For example, if you was looking for a shirt, and it was titled "White Shirt Brand", but you searched for "white shirt black collar", it would not find that product, because the title isn't what you searched on.
I'm use there use to be a good way to find it, so that the words "white" and "shirt" were in the criteria and it found it.
How does this work with PDO queries?
MySQL Query: how does MATCH work with PDO?
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
MySQL Query: how does MATCH work with PDO?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: MySQL Query: how does MATCH work with PDO?
Have you tried MATCH...AGAINST with some real queries? It might not behave quite how you want it to.
Anyway, there's nothing special about it with PDO. Prepared statement, plain query, it works just... normally.
Anyway, there's nothing special about it with PDO. Prepared statement, plain query, it works just... normally.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: MySQL Query: how does MATCH work with PDO?
I've tried "...OR MATCH(title) AGAINST (:search).
It works. Does give results that are not relevant, but if either word is in the title, it comes up, so I suppose it's bringing up the "correct" results.
It works. Does give results that are not relevant, but if either word is in the title, it comes up, so I suppose it's bringing up the "correct" results.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: MySQL Query: how does MATCH work with PDO?
It also tends to ignore words when a majority of rows contain it. Like if most said "Something Brand" then "Brand" in a search term would be ignored. But that may be desirable for you.