its duplicating the property id 2 times and adding a 1 from somwhere.
here is the url http://bre.gil.com.au/imagetest/xml_test4.php?property_id=323
the property id is 323
but the page is showing
2003-12-9-16:08:31
323
3231
here is the code.
<?php
$connection = mysql_connect("","","") or die('Could not connect to the database server');
$db = mysql_select_db("test", $connection) or die ("Unable to select database.");
$sql = "SELECT * FROM Listings WHERE id = $property_id";
$sql_result = mysql_query($sql,$connection) or die ("Could not connect to database");
$line = mysql_fetch_array($sql_result);
$tday = date("Y-m-j-H:i:s")."<br>";
echo $tday."<br>";
print $line["id"]."<br>";
$doc = new_xmldoc("1.0");
$PropertyList = $doc->add_root("PropertyList");
$PropertyList->set_attribute("date", "$tday");
$PropertyList->set_attribute("username", "nuvo");
$PropertyList->set_attribute("password", "xml4a11");
$residential = $PropertyList->new_child("residential", "");
$residential->set_attribute("modTime", "$tday");
$residential->set_attribute("status", "status1");
$agentID = $residential->new_child("agentID", "XNWVAN");
$uniqueID = $residential->new_child("uniqueID", print $line["id"]);
$authority = $residential->new_child("authority", "");
$authority->set_attribute("value", "auction");
$underOffer = $residential->new_child("underOffer", "");
$underOffer->set_attribute("value", "yes");
$listingAgent = $residential->new_child("listingAgent", "");
$name = $listingAgent->new_child("name", print $line_agent["agent_firstname"].print $line_agent["agent_lastname"]);
$telephonebh = $listingAgent->new_child("telephone", "telephoneBH#");
$telephonebh->set_attribute("type", "BH");
$telephonemb = $listingAgent->new_child("telephone", "telephoneMB#");
$telephonemb->set_attribute("type", "mobile");
$email = $listingAgent->new_child("email", "email");
$price = $residential->new_child("price", "price$");
$price->set_attribute("display", "no");
$price->set_attribute("plusSAV", "no");
$priceView = $residential->new_child("priceView", "priceView$");
$address = $residential->new_child("address", "");
$address->set_attribute("display", "yes");
$streetNumber = $address->new_child("streetNumber", "streetNumber");
$street = $address->new_child("street", "street");
$suburb = $address->new_child("suburb", "suburb");
$suburb->set_attribute("display", "yes");
$state = $address->new_child("state", "state");
$postcode = $address->new_child("postcode", "postcode");
$municipality = $residential->new_child("municipality", "municipality");
$streetDirectory = $residential->new_child("streetDirectory", "");
$streetDirectory->set_attribute("type", "type");
$page = $streetDirectory->new_child("page", "page");
$referance = $streetDirectory->new_child("reference", "reference");
$category = $residential->new_child("category", "");
$category->set_attribute("name", "name");
$headline = $residential->new_child("headline", "headline");
$description = $residential->new_child("description", "description");
$features = $residential->new_child("features", "");
$root = $doc -> dump_mem();
$doc-> dump_file('blog.xml',false,true);
?>
cheers aron.
this is the xml output.
http://bre.gil.com.au/imagetest/blog.xml