[php] flash search engine from mysql

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 :frowning:

Anyone can help me with this? Thanks in advance