List:General Discussion« Previous MessageNext Message »
From:Lance Uyehara Date:April 4 2002 7:17pm
Subject:Re: Query help
View as plain text  
> This will not work for my example.  I have a select box that was populated
> from the db with firstname lastname.  The option tag has the value of
> firstname+lastname then.  Here lies the problem, when I build the query, I
> have no way of distinguishing firstname and lastname.

if you really don't know the difference between firstname and lastname how
about something like:

select * from mytable where (first_name=$first && last_name=$last) ||
(first_name=$last && last_name=$first)

I suppose you could get duplicates if you have john+doe and doe+john.
-Lance


>
>
> > SELECT * FROM mytable WHERE first_name=$first && last_name=$last
> >
> > -----Original Message-----
> > From: Chuck Barnett [mailto:art_info@stripped]
> > Sent: Thursday, April 04, 2002 10:28 AM
> > To: mysql@stripped
> > Subject: Query help
> >
> >
> > Hi.  I have two fields, firstname, lastname.  I populate a select box
with
> > the firstname lastname.  Now when a user selects a name and hits submit,
> the
> > program will(should) select * from table where the selected name equal
> > firstname+lastname.  I guess you have to some how put the first and last
> > name together and compare the selected name to it....I dunno
> >
> > Thanks for help with this query.
> >
> > Chuck
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <mysql-thread105116@stripped>
> > To unsubscribe, e-mail
> <mysql-unsubscribe-remery=excel.com@stripped>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <mysql-thread105132@stripped>
> To unsubscribe, e-mail
<mysql-unsubscribe-lance=verniernetworks.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>

Thread
Query helpChuck Barnett4 Apr
RE: Query helpRick Emery4 Apr
  • Re: Query helpChuck Barnett4 Apr
  • Re: Query helpJohn Klein4 Apr
  • Re: Query helpLance Uyehara4 Apr
RE: Query helpRick Emery4 Apr
RE: Query helpLuc Foisy4 Apr