> If I'm understanding it correctly, you just have a full name in the import
> model and broken out first and last names in your contact model.

I may have not explained the setup properly. I don't actually have a
"full_name" field in either table (import_contacts and contacts are
the actual MySQL table names). Each of these tables have "fn" and "ln"
fields, however. So the problem is that I need to somehow find all
records in the contacts table which have the same values in the "fn"
and "ln" fields as the import_contacts table.

> Hmm. Is there a way you could make them directly correlate? It's a
> pretty fast DB query if you can get them to line up.

The only idea I have at the moment is to create a field in both tables
which simply stores the concatenated value of a record's "fn" and "ln"
fields. This would require me to write a script to retro-fit the
existing 30k contact records, as well as update some logic in my "add
contact" controller. Not to mention this would also create a redundant
field in the table and still doesn't ultimately solve the problem
because what if in the future I want to find duplicates matching "fn",
"ln" and "mi" (middle initial)? I would have to create yet another
"dummy" field in my table.

> The beauty of doing the heavy lifting in SQL, even if you can't do it
> in the ORM, is that you only have to bring the matches across the
> wire. So instead of a minimum of 30,000 records coming out of the DB
> (and each getting messed around with Cake's ORM) you get only the
> dupes.

Oh I hear you on this one :) Once I realized I *couldn't* do it with
SQL I was quite bummed! Of course, maybe there's still a way...

- Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to