hi all,
can any body help me?
if have a table in mysql and a code of php that when the user enters the full name, the php code queries the table and returns the results in a web page.
if the user enters for example in the text box the name without putting spaces between the first and the last name it will get no results, cuz it is stored with a space between them..
my question is: how can i make the code get the results of the nonspaced characters and recognize them as spaced characters if the spelling is right as stored in the table???
how can i make a comprehensive search query?
Moderator: General Moderators
-
a_naguib_2000
- Forum Newbie
- Posts: 5
- Joined: Fri Jul 22, 2005 7:33 am
-
a_naguib_2000
- Forum Newbie
- Posts: 5
- Joined: Fri Jul 22, 2005 7:33 am
If you can make a distinction between firstname and lastname... and only have a name attribute in your database... your database isn't normalized as it should be...
As mentionned already, offer for each column an input field.. Use all those that are !empty to build a WHERE clause and off you go... (Might want to use LIKE instead of = when people enter % in the inputfield)
As mentionned already, offer for each column an input field.. Use all those that are !empty to build a WHERE clause and off you go... (Might want to use LIKE instead of = when people enter % in the inputfield)