Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to search acoording to firstname ,lastname, city ,state, country and email id of all the registered users.....
i hv used one textbox for the search.....
but i am now trouble that how i identify that user hv entered only firstname or firstname and lastname or firstname ,lastname and country or firstname ,lastname and city or firstname ,lastname and state or firstname ,lastname, city ,state and country...
or he had entered the emailid ....

here i hv only one textbox which takes the value anyone who want to search...........
how can differenciate them from each otherb and can search the desired result..........

try to solve my problem........


thanks
Posted

You're not going to be able to conduct a meaningful search if you don't require a certain pattern for the search criteria.

I would require the user to type something like "first=john;last=simmons" in order to find someone named "john simmons".

You could extend this to be "first=john" + "last=simmons" + "city=san antonio", and even things like this:

"last=simmons" + "city=san antonio|dallas"

which would find everyone with the last name "simmongs" in either San Antonio or Dallas.

If the user uses the correct keywords, you can successfully parse the search string and return the desired results.
 
Share this answer
 
A better way to do this is to add a listbox with first name, last name, city... etc as the items.

Have whatever is in the listbox be the criteria for the search.

It will greatly reduce load and speed if you do this. Sometimes a little bit of work saves a much larger amount of debugging.
 
Share this answer
 
Comments
aryan2010 18-Jun-10 16:14pm    
if u hv an orkut acoount then u hv not given such a suggestion of using listbox.........
using a textbox and getting desired result is difficult but not impossible.....
in orkut there is only one text box and u search friends as u wish......

thanks for replying.........
You could consider contacting your client and telling them they are a moron, then moving on to a sensible UI design.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900