Jump to content

Command to search for something "similar"


MortimerJazz

Recommended Posts

That's not a very descriptive title, so let me try and explain what I want to do.

 

Basically, when a user searches through the database, I don't want the results page to show up blank if nothing matches the criteria which the user has inputted. Therefore if the database doesn't find an exact match, it would be nice if it brought up records which were similar to what the user wants.

 

So let's say someone's looking for a car and wants a 4 Door Red Audi. Nothing like that is in the database, but I'd like my script to effectively say "We don't have that, but we do have a 4 Door Blue Audi"

 

Can anyone suggest the best way of doing this please?

 

Thanks,

Link to comment
https://forums.phpfreaks.com/topic/40330-command-to-search-for-something-similar/
Share on other sites

Hi Fenway,

 

Thanks for the reply.

 

Most of the content is stored in VARCHAR fields or short text fields. Stuff like the number of doors is stored in NUMBER fields and any features like (leather seats, 4WD to keep the example above going) is recorded by a "TRUE" in the relevant field name.

 

Does that help at all?

  • 1 month later...

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.