title: Save to a XML document using php problem
body: <p>Hey all. I'm trying to save A XML file using php. here is my code, the connection to the DB is okay and all, i can use <strong>$dom->saveXML()</strong> but the save function isn't saving nothing.
  please help.</p>
  
  <pre><code>&lt;?
  $db_selected = mysql_select_db($database, $connection);
  if (!$db_selected) {
    die ('Can\'t use db : ' . mysql_error());
  } 
  
  // Select all the rows in the markers table
  
  $query = "SELECT * FROM Listing_Arnona WHERE 1";
  $result = mysql_query($query);
  if (!$result) {  
    die('Invalid query: ' . mysql_error());
  } 
  
  
  
  // Iterate through the rows, adding XML nodes for each
  
  while ($row = @mysql_fetch_assoc($result)){  
    // ADD TO XML DOCUMENT NODE  
    $node = $dom-&gt;createElement("marker");  
    $newnode = $parnode-&gt;appendChild($node);   
    $newnode-&gt;setAttribute("Price",$row['Price']);
    $newnode-&gt;setAttribute("PriceS", $row['Price']);  
    $newnode-&gt;setAttribute("address", $row['street_name']);  
    $newnode-&gt;setAttribute("NumRooms", $row['Room_Num']);  
    $newnode-&gt;setAttribute("PROMO", $row['PROMO']);
  } 
  
  $dom-&gt;formatOutput = true; 
  $test1 = $dom-&gt;saveXML(); // put string in test1
  $dom-&gt;save('test1.xml'); // save as file
  
  ?&gt;
  </code></pre>