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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.