Pagina 1 din 1

XML Data to Database using PHP

Scris: Lun Sep 29, 2008 3:22 pm
de navioo.com
I have a task where i need to read data from XML Spreadsheet and store to Mysql Database.

While i was searchin google i got a link where he says the way to read data from XML Spreadsheet to Database


But there are few lines in the code where i don't have those functions. Also I don't know wheather they are predefined function from PHP Lib.

$dom = DOMDocument::load( $_FILES['file']['tmp_name'] );
$rows = $dom->getElementsByTagName( 'Row' );

while I run the Import.php page in the browser, I see

Call to a member function load() on a non-object in C:\xampp\htdocs\xampp\projects\xml_to_db\import.ph p on line 38


Also there is a line that says
$cells = $row->getElementsByTagName( 'Cell' );

and when i run this page also says

Call to a member function getElementsByTagName() on a non-object in C:\xampp\htdocs\xampp\projects\xml_to_db\import.ph p on line 38

I dont know where the function getElementsByTagName() is in the page give.

So Guys, Please help me regarding this, as do i need to do anything PHP.INI file inorder to run my dom functionality ( removing or puttin " ; " in front of the extensions ).

thanks & regards

Scris: Lun Sep 29, 2008 4:03 pm
de Amenthes