PDA

View Full Version : [php] flash search engine from mysql



alapimba
July 16th, 2004, 01:18 PM
Hello i want to make a search engine on a flash site, anyone can help me?

what i want is have 2 kind of results. the search is to find stores.
but it has to work for 2 kinds of results.
the sql database will have this fields:

regions | citys | adresses

But lets imagine someone type his small city i want the exact store, but if someone type one region i want the result to be all stores in that region...

I guess this is probably very simple but i'm searching for a tutorial at about 4 hours and no luck yet :(

Anyone can help me with this? Thanks in advance

eyezberg
July 16th, 2004, 04:18 PM
Direct the user to make life easier for you:
1. basic search = drop-down with regon names, then in your sql, select * from stores where region is $region
2.advanced search: have user select region (to limit database access), then input (or select, up to you) city => i would dynamically populate a new drop-down with available city names when user makes his selection in the region d-d..

Hans Kilian
July 16th, 2004, 04:25 PM
I'd do a select like this
$sql = "Select * from stores where region like '%$search%' or city like '%$search%'";
where $search contains the search string entered by the user.

If it only returns one row, then jump directly to that store. If it returns multiple rows, show the user a list of the stores.

alapimba
July 16th, 2004, 07:03 PM
er... i understand how it should be.. but can someone give me an example of code or tell me a easy to understand tutorial like.. step by step what should i do...:blush: