Is there a way to to impliment automatic wild card searches.
Example someone types in the zip code 90210 in the search screen.
Its automatically changed to 902*
Yielding the results
90210 90213 90245 . . . . and so on
coopster
1:30 pm on Mar 19, 2006 (gmt 0)
Sure. If the data is coming from a database all you have to do is modify the search query to add a LIKE keyword:
SELECT zip_code FROM mytable WHERE zipcode LIKE '902%';
columbus
5:14 pm on Mar 23, 2006 (gmt 0)
I dont think I can use a sql string here.
This is for a phpbb search on my site for the users of the forum . . . not me. I think I can accomplish this task by using a "form" but not sure how to write it.
If I can use sql how do i do this?
coopster
5:33 pm on Mar 23, 2006 (gmt 0)
Sure you can. As a matter of fact, that is what I thought you were describing in your first message. In a nutshell, you would:
Create the HMTL form which accepts user input.
Edit the input to make sure it contains digits; keep the first three digits, discard the rest. Use that to build your query statement.
Execute the query statement, process the result set and display the information.