Mysql joining table data, needing to drag out data from both in 1 query

damongull

New Member
So i am generating a XML file based on data from mysql tables but need to be able to get the data i want from 2 tables using my query and unsure how to do this. details are as follows:\[code\]TABLE: store_locations===================================store_location_idcountrylatitudelongitude===================================TABLE: store_locations_descriptions===================================store_location_idnamedescriptioncity===================================\[/code\]PHP Function:\[code\]// Function to generate XML file based on store data from databasefunction fn_store_locator_generate_xml(){ $qur = db_get_field("JOIN QUERY WANTED HERE"); $ans=mysql_query($qur); $output.= "<?xml version=\"1.0\" encoding=\"UTF-8\"?><kml xmlns=\"http://earth.google.com/kml/2.2\"><Document>"; while($row=mysql_fetch_array($ans)) { $output.="<name>".$row['name']."</name>"; $output.="<description>".$row['description']."</surname>"; $output.="<Placemark>"; $output.="<name>".$row['name']."</name>"; $output.="<Snippet>".$row['description']."</Snippet>"; $output.="<description>".$row['description']."</description>"; $output.="<Point>"; $output.="<coordinates>".$row['latitude'].",".$row['longitude']."</coordinates>"; $output.="</Point>"; $output.="</Placemark>"; $output.="</person>"; } $output.="</Document>"; $file_name = "galleries.xml"; $file_pointer = fopen($file_name, "w+"); fwrite($file_pointer, "$output"); fclose($file_pointer);}// generate the XML filefn_store_locator_generate_xml();\[/code\]Many Thanks in advance!
 
Back
Top