Re: RE: [PHP-DB] Query question about how to do a select which return s things that resemble the input
| From: | Yurais Fernandez Leal | Date: | Thu, 22 Jun 2000 19:23:27 +0000 |
| Subject: | Re: RE: [PHP-DB] Query question about how to do a select which return s things that resemble the input | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-general+get-2840@lists.php.net to get a copy of this message | ||
I've read the function in the manual , I can't figure out how to make
it work :-)
I read this in the example:
Example 1. Soundex Examples
1
2 soundex ("Euler") == soundex ("Ellery") == 'E460';
3 soundex ("Gauss") == soundex ("Ghosh") == 'G200';
4 soundex ("Knuth") == soundex ("Kant") == 'H416';
5 soundex ("Lloyd") == soundex ("Ladd") == oL300';
6 soundex ("Lukasiewicz") == soundex ("Lissajous") == 'L222';
7
and ?
On Wed, 21 Jun 2000, Mark Roedel wrote:
roedel: > I would suggest you break down Terdam into segments of varying
roedel: > length. I got a bit carried away so i attched a function and
roedel: > an example.
roedel: > It should result in something like;
roedel: > SELECT
roedel: > *
roedel: > FROM
roedel: > mytable
roedel: > WHERE
roedel: > afield = 'foo' and
roedel: > anotherfield = 'bar' and
roedel: >
roedel:
roedel: > LOWER(myfield) like '%terdam%' OR
roedel: > LOWER(myfield) like '%terda%' OR
roedel: > LOWER(myfield) like '%erdam%' OR
roedel: > LOWER(myfield) like '%terd%' OR
roedel: > LOWER(myfield) like '%erda%' OR
roedel: > LOWER(myfield) like '%rdam%' OR
roedel: > LOWER(myfield) like '%rda%' OR
roedel: > LOWER(myfield) like '%erd%' OR
roedel: > LOWER(myfield) like '%dam%' OR
roedel: > LOWER(myfield) like '%ter%'
roedel: > )
roedel: >
roedel: > [snip]
roedel:
roedel: This is starting to look like the sort of thing which might get a whole lot
roedel: simpler if it took advantage of soundex (assuming a database that supports
roedel: it).
roedel:
roedel: Hmmm...except that might present some different challenges with regard to
roedel: substrings.
roedel:
roedel: Oh well...potentially worth reading up on, anyway...
roedel:
roedel: http://www.dcs.ed.ac.uk/home/stg/pub/S/soundex.html
roedel: http://www.mysql.com/php/manual.php3?section=String_functions
roedel: http://www.php.net/manual/function.soundex.php
roedel:
roedel:
roedel: ---
roedel: Mark Roedel (roedelm@letu.edu) || We have only two things to worry about:
roedel: Systems Programmer / WebMaster || That things might never get back to
roedel: LeTourneau University || normal, and that they already have.
roedel:
roedel:
roedel:
--
----------------------------------
Yurais Fernández Leal
MediRed Network SysAdmin.
yurais@medired.scu.sld.cu
http://www.scu.sld.cu/
ICQ: 33792610 ICQ-GW: 1031
Phone: (53) 226-54204
------------