Jump to content

[SOLVED] searching patterns with a group of id's


mungyun

Recommended Posts

Im not sure if this would require more php or sql to do so im sorry if it is in the wrong place but I have this column in my table that contains entries with various part id's separated by a delimiter that i need to be able to match. Something like: "2|6|7|9|1"

 

On the users side they will select various parts and i need to take the id's from their selections and compare it to find closest matches

 

this is for a machines search by parts that needs to return by relevance so the table column would be like this:

 

[machine_part_ids]

"1|5|6|3|9"

"9|1|7|5|23|21"

"18|4|23|22"

"5|1|23|7"

 

and the user has selected parts: 1, 5, 7 and 23

 

i want to be able to return the results that have the closest match to the least closest. So the above column entries would return in this order:

"5|1|23|7"

"9|1|7|5|23|21"

"1|5|6|3|9"

"18|4|23|22"

 

If it would make it easier, i could enter the id groups in order but im not sure if that would be needed

 

I hope i explained this good enough and if i need to explain more i would be glad to.

 

Any help is greatly appreciated =-)

 

Thanks,

 

Matt

 

 

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.