Fellow Monks... maybe not a truly perl perl question... but the solution will be in Perl so I dont feel so Guilty...
So take this simple example, I have a table in my database which is full of city names which mate to IATA codes.. for instance
London = LON Miami = MIA Paris = PAR
So we have a user comes in and enters London... great so we do a select where city name = 'London'.... but then the user cunningly enters London, UK... which of course my original select wont work.... nor would any like statements..
So... maybe I use Soundex... (mysql Soundex in this case)... so I use said function... and so I check this and I get..
select soundex('London'), soundex('London, UK')
Which gives me L535 and L5352... so getting better...maybe do some comparison of first X bits ??Then I look at user entering UK - London... Soundex not going to like that coming back with U24535...
Now I could take to the next point of no matches... so I split it... but on what ? use could enter spaces, - ',' etc etc...
Now dont get me wrong I can deal with the majority of the cases using likes, soundexs.... but maybe there is a better way ??In reply to Matching in the Database... by ropey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |