# \[php\] flash search engine from mysql

**URL:** <https://forum.kirupa.com/t/php-flash-search-engine-from-mysql/57846>\
**Category:** programming\
**Created:** [July 16, 2004, 5:18pm UTC](https://forum.kirupa.com/t/php-flash-search-engine-from-mysql/57846 "2004-07-16T17:18:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alapimba](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@alapimba](https://forum.kirupa.com/u/alapimba)\
**Post date:** [July 16, 2004, 5:18pm UTC](https://forum.kirupa.com/t/php-flash-search-engine-from-mysql/57846/1 "2004-07-16T17:18:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 16, 2004, 8:18pm UTC](https://forum.kirupa.com/t/php-flash-search-engine-from-mysql/57846/2 "2004-07-16T20:18:03Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 16, 2004, 8:25pm UTC](https://forum.kirupa.com/t/php-flash-search-engine-from-mysql/57846/3 "2004-07-16T20:25:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 16, 2004, 11:03pm UTC](https://forum.kirupa.com/t/php-flash-search-engine-from-mysql/57846/4 "2004-07-16T23:03:42Z")

</div>

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…😊
