Re: [PHP] Re: find (matching) person in other table
- From: afan@xxxxxxxx (Afan Pasalic)
- Date: Thu, 31 May 2007 09:36:28 -0500
Jared Farrish wrote:
On 5/30/07, Afan Pasalic <afan@xxxxxxxx> wrote:'cause some members can be added to database by administrator and maybe they don't have email address at all. or several memebers can use the same email address (sale@xxxxxxxxxxxxxxx) and then macthing last name is kind of "required". that's how it works now and can't change it.
email has to match "in total". sales@xxxxxxxxxxxx and info@xxxxxxxxxxxx
are NOT the same in my case.
thanks jared,
If you can match a person by their email, why not just SELECT by email only
(and return the persons information)?
Consider, as well, that each time you're calling a database, you're slowingagree. now, I have to figure it out HOW? :-)
down the response of the page. So, while making a bunch of small calls might
not seem like that much, consider:
||||||| x |||||||
||||||| a |||||||
||||||| b |||||||
Versus
||||||| x, a, b |||||||
The letters represent the request/response data (what you're giving to get,
then get back), and the pipes (|) are the overhead to process, send, receive
(on DB), process (on DB), send (on DB), receive, process, return to code.
The overhead and latency used to complete one request makes it a quicker,
less "heavy" operation. If you did the first a couple hundred or thousand
times, I would bet your page would drag to a halt while it loads...
I was looking at levenshtein, though, I think the richard's solution is just enough:
select member_id, first_name, last_name, email, ..., (5*(first_name='$first_name) + 2*(first_name='$first_name')) as score
from members
where score > 0
though, I'm getting error: "Unknown column 'score' in where clause"?!?
thanks jared.
.
- Follow-Ups:
- Re: [PHP] Re: find (matching) person in other table
- From: "David Giragosian"
- Re: [PHP] Re: find (matching) person in other table
- References:
- Re: find (matching) person in other table
- From: "Jared Farrish"
- Re: [PHP] Re: find (matching) person in other table
- From: Afan Pasalic
- Re: [PHP] Re: find (matching) person in other table
- From: "Jared Farrish"
- Re: [PHP] Re: find (matching) person in other table
- From: Afan Pasalic
- Re: [PHP] Re: find (matching) person in other table
- From: "Jared Farrish"
- Re: find (matching) person in other table
- Prev by Date: Re: [PHP] file_get_contents and https
- Next by Date: Re: [PHP] Re: find (matching) person in other table
- Previous by thread: Re: [PHP] Re: find (matching) person in other table
- Next by thread: Re: [PHP] Re: find (matching) person in other table
- Index(es):
Relevant Pages
|