I want to use SOUNDEX for name queries, but I don't
seem to be doing it correctly.
As a test, I made a small table and popluated it
with my name. My goal is to be able to find my name
'Callaghan', with its most common misspelling
'Callahan'.
I've read the MySQL doc, so I know how to actually
invoke soundex at the mysql prompt. I read an
article that said soundex queries move more quickly
if you add a column for the soundex.
Thus:
CREATE TABLE sound (
id tinyint(3) NOT NULL auto_increment,
name varchar(100) default NULL,
sound varchar(100) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
select soundex('Callaghan');
result = C425
INSERT INTO sound VALUES (1, 'Callaghan', 'C425');
Simple enough. Now, I expected all three of the
following queries to return a value.
select id from sound where sound =
soundex('Callaghan');
returns 1 records
select id from sound where sound =
soundex('Callahan');
returns 0 records
select id from sound where name =
soundex('Callaghan');
returns 0 records
I'm missing something obvious here, but I've read
the doc and I'm not sure what's wrong.
--
Get your free email from www.linuxmail.org
Powered by Outblaze
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php