| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
| 8:47 pm on Jun 25, 2010 (gmt 0)|
I can't seem to work this out. Spent about 30 minutes digging through the net.
Why doesn't this work:
"SELECT client_id,fname,lname FROM clients WHERE fname OR lname = '$search_val'";
| 8:53 pm on Jun 25, 2010 (gmt 0)|
Welcome [webmasterworld.com] to WebmasterWorld!
Because there is no conditional on fname.
I believe this is what you mean:
WHERE fname = '$search_val' OR lname = '$search_val'
| 8:54 pm on Jun 25, 2010 (gmt 0)|
Hi there Discord,
Welcome to the forum :)
Good news is you are almost there, try this:-
"SELECT `client_id`, `fname`, `lname` FROM `clients` WHERE `fname` = '".$search_val."' OR `lname` = '".$search_val."' ";
That should be ok, you see the logic there hopefully,
[EDIT:] Great minds think alike ;)
[edited by: Matthew1980 at 8:55 pm (utc) on Jun 25, 2010]
| 8:55 pm on Jun 25, 2010 (gmt 0)|
a-ha! so simple.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved