...

View Full Version : domxml error php



niladhar
08-25-2009, 07:47 PM
i get an error for the following code in which i am trying to append to an xml file with data from the data base. I get the error only when i upload the file to my host 1and1 and on my local system i donot have any problems.



<?php
include('../mysql.php');
$obj=new db();
$obj->connect();
$qry="select order_id from orders";
$res=$obj->query($qry);
while($newarray=$obj->fetch($res))
{
$orders[]=$newarray['order_id'];
}


$doc = new DOMDocument();
$doc->formatOutput = true;

$r = $doc->createElement( "orders" );
$doc->appendChild( $r );

for($i=0;$i<sizeof($orders);$i++)
{
$b = $doc->createElement( "order" );

$num = $doc->createElement( "num" );
$num->appendChild( $doc->createTextNode( $orders[$i] ) );
$b->appendChild( $num );

$r->appendChild( $b );
}

echo $doc->saveXML();
$doc->save("orders.xml")
?>


I googled as much as i could and found out that the
extension=php_domxml.dll {for windows}
extension=php_domxml.so {for linux}

must be commented out in the php.ini file.

i did that as well and uploaded my own version of the php.ini file on the root and the directory from where i was calling this code, but no luck....

does any one know what the issue is, AM I USING FUNCTIONS OR STANDARDS WHICH HAVE BEEN DEPRECATED.

Im using linux hosting by the way.

following is the error that i get.




Fatal error: Call to undefined method: domdocument->createelement() in /homepages/39/d284887719/htdocs/admin/OFS/includes/dataset/write_orders.php on line 16



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum