Jump to content

MySQL LOOKS LIKE script


timvdalen

Recommended Posts

Hi,

 

I'm curious if someone ever wrote a script that did this.

This would be cronstructing a query where a search is done for rows where a column has up to two or three other letters in it.

I could write it myself, but it's only a small part of the project I'm working on, so if it doesn't already exist I'm just gonna ignore it.

 

Tim

Link to comment
https://forums.phpfreaks.com/topic/208901-mysql-looks-like-script/
Share on other sites

Database with the following data:

1

John

2

Eliza

3

Tiffany

User searches for 'Elisa', it should return the row with id 2. If the user imput is 'Tifany', row 3 should be returned. Some more examples:

Jon, Jhon, Liza (although this is just a matter of LIKE %...%)

 

 

Interesting... Took me a while to get how it worked (I used the function on only one of the two values) but it works like a charm.

Thank you.

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.