I posted earlier on how to get data out of a database and plot it on a map. I managed to do so by using PHP to get the data from the db, export the data as an xml file (more like a variable, it doesn't make a physical file) and then letting the javascript read the xml.

I have a database called google and a table called markers. The SQL for the data in the database is:

There are 2 types in this example, a bar and a restaurant. I need to be able to click on restaurant and only the markers with type restaurant will show, and if bar is selected, only type bar will show.

I tried forcing the links to have a 'get' variable and try pick it up in PHP:

Which when I run the genxml3.php file, gives me an xml file that has only type restaurant in it, no type bar, which is EXACTLY what I want, but then the map doesn't recognize the change and still displays both type restaurant and bar.

How can I force the JavaScript to change when a link is pressed? how can I get the JavaScript to run the PHP file with the 'get' variable and only output the type specified?