Re: Searching a full name
Re: Searching a full name
- Subject: Re: Searching a full name
- From: "Jonathan Fleming" <email@hidden>
- Date: Sun, 26 Sep 2004 07:17:31 +0100
Hello William,
Thanks for your post... this seems like the most logical route to take, yep
I can make sense of that and will get to it.
The answers always sitting in front of you, but for the life of me I doubt
whether I would have got to this in a hurry.
Regards
Jonathan :^)
ps. Thanks to everyone else who posted on this too, it all helps towards the
thinking process. ;^)
From: William Norris <email@hidden>
Reply-To: William Norris <email@hidden>
To: Jonathan Fleming <email@hidden>, "WebObjects (Group)"
<email@hidden>
Subject: Re: Searching a full name
Date: Sat, 25 Sep 2004 13:19:17 -0500
On Sat, 25 Sep 2004 18:48:56 +0100, Jonathan Fleming
<email@hidden> wrote:
it's this what is my problem:
> ((firstName like $tradingName) and (lastName like $tradingName)) but
could
> make it function correctly so started to add the whitespace column but I
> know for sure that I'm doing something seriously back to front, I just
cant
> think so... I need someone's fresh head 'cause mine's is still awash
with
> sleep deprivationform this week.... silly me.
(I'm guessing you have a single input box where the user can enter
their full name). When the form is submitted, $tradingName
potentially holds two pieces of information -- both the user's
firstname as well as their last name. The easiest (and probably most
logical) thing to do would be to split $tradingName wherever their is
a whitespace and treat each substring as an individual token. They
might have entered last name first, so you'll want to check each token
against each database field.
for example, if $tradingName had one space in it, and you split it
into two strings, $tn1 and $tn2, your qualifier would look something
like... (((firstName like $tn1) or (lastName like $tn1)) and
((firstName like $tn2) or (lastName like $tn2))).
This could (and probably should) be expanded a bit to account for
multiple spaces, commas between last and first name, etc.
_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden