RE: find (matching) person in other table



Hello Afan & list,
I recently coded such an animal for a customer. It is a quick and dirty piece of work. They had an existing dataset and wanted to match new registrants against the dataset so as to avoid duplication. First we applied logic to not accept duplicate email addresses in the registration, and sent the potential duplicate user off to the password lookup page. Next we assigned a contact_type, usertype, and sales_status:

contact_type enum( "company", "individual") default "company";
usertype enum( "primary", "secondary", "other") default "primary";
sales_status enum( "open", "hide") default "open";

Explanation
Customer is using data for contact management and sales.
sales_status lets the admin toggle off visibility, so as to hide records they don't want to see
usertype lets multiple users exist from the same company - we can track everyone in their organization :), but only one is the primary contact

Match script
So next the match script was built which allows the admin to surf thru the dataset, and lookup any string. Of the data fields these were found to be significant for us:

username, email, companyname

So the Find Match script lets you click on any of username, email, companyname and pulls out LIKE "$username%" or LIKE "$email%" (but just the domain part) OR LIKE "$companyname%" examples, depending on what you selected. This yields a match in the last part, but not the first, of the selected match variable. I did not apply a percentage result such as you suggest. Matches can and are found in almost every data field. The trained human eye works better than a percentage, always will. Anyway, because the script result returns ONE LINE PER RECORD, and this line contains clickable links to match email, match username or match company (and edit record and other stuff), it lets the admin keep surfing thru the database finding matches, or not.

I arbitrarily limited matches to 20 rows, since the user can click on any line to initiate another match of a particular value, its not a biggy to keep searching, in fact, its fun and almost addictive ;)

Lastly I added on basic tools so the admin could change any of the values for any of the data fields. So the tool has a byproduct feature of letting the admin clean up their dataset while they're matching.

The sales person even had his wife doing match lookups for him within the week :)

This I'm sure is not the best or only way, but that's what we did, it works, and the customer is happy. Maybe it will help you too.

Sincerely,
rob
http://phpyellow.com

=======================================
Date: Wed, 30 May 2007 15:30:59 -0500
From: Afan Pasalic <afan@xxxxxxxx>
To: php-general <php-general@xxxxxxxxxxxxx>
Subject: find (matching) person in other table
hi,
the code I'm working on has to compare entered info from registration
form with data in members table and list to administrator (my client)
all "matching" people. admin then has to decide is person who registered
already in database and assign his/her member_id or the registered
person is new one and assign new member_id.

I was thinking to assign points (percentage) to matching fields (last
name, first name, email, phone, city, zip, phone) and then list people
with more than 50%. e.g., if first and last name match - 75%, if only
email match - 85%, if first name, last name and email match - 100%, if
last name and phone match - 50%... etc.

does anybody have any experience with such a problem? or something similar?

thanks for any help.

-afan
.



Relevant Pages

  • Re: [PHP] find (matching) person in other table
    ... form with data in members table and list to administrator (my client) ... I was thinking to assign points to matching fields (last ... perfect, no mater how much you tweak it -- I mean, let the admin also ...
    (php.general)
  • Re: RPC failed while 2 PCs connected
    ... I was logged in with admin access on both computers. ... DragoII has a matching, non-blank password, activated for network ...
    (microsoft.public.windowsxp.network_web)
  • Temporary local admin rights for non-administrator users
    ... laptops who live in various parts of the country. ... I get a call where a sales guy needs to do something with the ... a one time use executable to the employee via email that when executed, ... will give this employee admin rights only for the current login ...
    (comp.os.ms-windows.nt.admin.security)
  • Re: Workgroup File
    ... Then I cleared the password on the Admin user. ... When I check the permissions using the Customer shortcut it logs me in as ...
    (microsoft.public.access.security)
  • RE: How much do you disclose to customers?
    ... our IP's blocked by an IPS or by an unwitting admin. ... from multiple machines has its advantages, especially when given a class C or larger to split up the time. ... Logs are definitly important, one thing I wish automated scanners ... >> I have a question on customer disclosure. ...
    (Pen-Test)