Jump to content

How to get a PHP Search form to suggest alternatives in MySQL database?


mattc_uk

Recommended Posts

Does anyone know a function or way that I can get my php search form to suggest alternatives when zero results are returned?

 

Ideally it would look through the database column that has just been searched and suggest some records that are close to what was typed... is this possible?

 

 

well i think you need some hardcore regular expressions for this and a table with keywords. otherwise I would have no idea how to do this.

I think this is pretty difficult.

Might be possible by shortening down the term they where searching for multiple ways and then search with an extensive "OR" list in either keyword table or directly in the text, not that this would probably strain your mysql database a lot (even with great indexing).

Might be possible by shortening down the term they where searching for multiple ways and then search with an extensive "OR" list in either keyword table or directly in the text, not that this would probably strain your mysql database a lot (even with great indexing).

 

instead of OR you could use REGEX in an sql query too.

Might be possible by shortening down the term they where searching for multiple ways and then search with an extensive "OR" list in either keyword table or directly in the text, not that this would probably strain your mysql database a lot (even with great indexing).

 

instead of OR you could use REGEX in an sql query too.

 

Yes but if im not misstaking regexp search slower, but then again would be a lot of ORs so might be faster with regexp search... Anyway he should test what works best and run with that..=)

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.