Intelligent closest match detection with names in MySQL and PHP -
say have mysql table 1 below list of names in organisation, , ids each.
id name 1 john doe 2 richard smith 3 jane market ... ...
given user query person's first and/or last name (with possibility of typos , nicknames used) , php should return closest match query.
for example, if user enters "ricky" (nickname richard), should return id richard smith.
for nicknames, have create separate mysql table, lookups (many-to-one relationship).
for typos, have loop of names , compare them user has entered using levenshtein function, or similar_text function. user contributed notes help.
Comments
Post a Comment