Doing a Multiple Search
| From: | Hunter, Jess | Date: | Tue, 04 Mar 2003 13:50:14 +0000 |
| Subject: | Doing a Multiple Search | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138101@lists.php.net to get a copy of this message | ||
I know this must be an easy solution, just not seeing what it is.
I have tried to add several options to the below code but can't seem to get
it right.
Here is the Base Line I am working with:
$Query="SELECT * from $TableName WHERE lastname='$Array[lastname] AND
firstname='$Array[firstname]' ";
What I ant to be able to do is a search on both the lastname and the
firstname so if someone just puts in the last name it will display all
people with the queried last name regardless of the first name. So for the
visual representation
If I search for Bob Smith, it will give me:
Smith Bob
If I search by last name Smith, it will give me
Smith Bob
Smith John
Smith Mike
Any and all help would be greatly appreciated.
Thanks in Advance
Jess