I believe you could use CONCAT(firstname, ' ', lastname) LIKE
'%$searchname%'

if you leave the space out of the middle it probably won't work, and you
might want to trim firstname & lastname to make sure no leading or trailing
spaces exist.

Hope this helps,

P
-----Original Message-----
From: *Himerus* [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 10:09 PM
To: [EMAIL PROTECTED]
Subject: SELECT HELP


How do I use the select feature in this situation.



I have a total of 5 fields that deal with names.. Three of the five are
completely separate, and use one field for both first and last name. the
last two fields are the first and last name of the person submitting the
information..



When I do a select if someone searches for "joe" or "smith" it will pull
up the info on all fields. but if someone searches for "joe smith" it
will ONLY pull up the entries that match in the first three fields. it
is imperative that I make this work. I can't change the layout of the
table at this point, but I'm sure there's a way to combine two fields in
the select and try to match two fields in the table to one field in the
search form..





Here's a sample of the code..





("SELECT * FROM newsibsdatabase WHERE (firstname LIKE '%$searchname%' OR
lastname LIKE '%$searchname%' OR adopteename LIKE '%$searchname%')





now, can I add in a option that is something like this  OR ("firstname
lastname" LIKE '%$searchname$')



how would this work..



Thanks in advance..



Jake.


---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to