Jump to content

mysql search.


becu

Recommended Posts

Hi,

 

I'm trying to write a search function for my site. Let say a user input "my lovely dog", then

if my site has an article let say: "my cute lovely but not very friendly doggy" -> then there's a match.

but if my site has an article: "my friendly doggy lovely" -> then my search can't find this article.

 

My question is how do you swap input text, so that it doesn't matter what order the users input, it can always find matched article.

 

my above sample would be: my lovely dog, dog my lovely, lovely dog my...will be matched with an article entitled "my cute lovely but not very friendly doggy".

 

Thanks.

 

 

Link to comment
https://forums.phpfreaks.com/topic/123989-mysql-search/
Share on other sites

fenway,

I don't own the server. I just need an okay search method for now. I guess this is more of a PHP question.

 

let say I have an array of 3, 4 elements. Can you propose an algorithm to swap elements and get all possible arrays from this one array?

 

$arr = array("a", "b", "c");

==> I want (a, b, c) (a, c, b) (c, a, b) (c, b, a) (b, a, c) (b, c, a)

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-640190
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.