• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need help with database trigger and rewriting XML file for website

dalearyous

Senior member
Setup:
linux (ubuntu) web server using phpMyAdmin (database)

Layman's Terms:
Currently when you go to my website you can register. When you register, it populates a table in phpmyadmin with information like name address etc... I then have a geocoder which runs and spits out your coordinates of your address and stores them in the database as well along with your name. All this works just fine. Even my map (no not google maps) works just fine.

What i want is every time someone registers i want a pin to be thrown onto the map with their name at the proper coordinates. Right now, the pins on the map are controlled by and XML file. A typical pin (flag) looks like this:

<state id="point">
<name>Person's Name</name>
<loc>x coord, y coord</loc>
<hover>City</hover>
</state>

Now i can go in and manually edit the xml file and the flags show up on the map...but thats no fun. I want the easiest way possible, like trigger or something, so anytime the database gets updated there is a loop that runs and loops through the database and rewrites the XML file with the most current variables. OR An easy way to do it i think would be to every time someone registers i could have the xcoord variable and the ycoord variable written into the xml file along with their name etc...but it would have to append the file and i don't know how to do that either.

Thoughts? Ideas? Point me in the right direction or the exact answer would be nice 🙂
 
It would probably be easiest to update the xml file from php before or after you hit the database. I don't write much php though, so I can't help with the exact approach. Or, along the lines of what you were suggesting: just run a query to spit out the complete XML file after someone registers.
 
yeah i was thinking that once they hit the register button, when all the values get written into the database i could just put something there to append the xml file.
 
Back
Top