On Jul 23, 8:27 pm, opusrandy <[email protected]> wrote:
> What we WANT it to do...is we want to set
> up a static page with a list of branches for a particular state, and
> then somehow pass the url when the branch name is clicked, so that the
> locator I currenltly have grabs only the branch_id you had clicked on.

OK... you currently have
  $center_lat = $_GET["lat"];
  $center_lng = $_GET["lng"];
  $radius = $_GET["radius"];
which take those parameters from the url. Add another one for "name"
since you already have that in your database -- or create an id column
in your database and add such a line for "branch_id".

Then get your code to decide what to do based on whether it gets a
branch_id or not:
  if ($branch_id) {
    $query = sprintf("SELECT address, name, lat, lng,
    0 as distance FROM markers WHERE branch_id='%s'",
    mysql_real_escape_string($branch_id)); }
  else {
    // do your existing query
    }

Then carry on as before. Note that I've specified retrieving a column
called "distance" with a fixed value of zero, just so that any
subsequent code will find something there.

The while loop which iterates through the result set should only ever
find one row retrieved with a particular branch_id, but even if there
are more for some reason, the code won't fail: it will simply show
them all.

As you say, you will need some identifier for each store in your
database. It could be the existing name, or a store number, or maybe
even the zipcode if you have only one or two per zipcode. Up to you.

Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to