473,394 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to import xml into mysql using PHP4.3.1

1
hi,
I am getting problem with imorting a xml file into database.
I'm using DOM object to extract the data from xml file.
But when i tried to execute it in linux hosting it shows an error
Fatal error: Call to undefined function: load()
If some one will help me I will gratefull.

my code is below

Expand|Select|Wrap|Line Numbers
  1. $docs = new DOMDocument();
  2.  //$docs = DOMDocument::load( test.xml);
  3. $docs->load(test.xml);
  4.  $rows = $docs->getElementsByTagName( 'Row' );
  5. $first_row = true;
  6. //$datas = $docs->getElementsByTagName( "book" );
  7. foreach( $rows as $row )
  8.  {
  9.     if ( !$first_row )
  10.     {
  11.     $cells = $row->getElementsByTagName( 'Cell' );
  12.     foreach( $cells as $cell )
  13.     { 
  14.     $ind = $cell->getAttribute( 'Index' );
  15.     if ( $ind != null ) $index = $ind;
  16.  
  17.     if ( $index == 1 ) $email = $cell->nodeValue;
  18.     if ( $index == 2 ) $status = $cell->nodeValue;
  19.  
  20.     $index += 1;
  21.     }
  22.     }
  23.     $first_row = false;
  24. }
[Please use CODE tags when posting source code. Thanks! --pbmods]

Thanks
Amar
Jun 29 '07 #1
1 2665
pbmods
5,821 Expert 4TB
Heya, Amar.

For PHP4, you need to use DOM XML instead.
Jun 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: David | last post by:
Hi, I am running Debian 3.0r1 with Apache 1.3.27, MySQL 3.23.49 and PHP 4.3.3RC3. I installed Apache and MySQL when I originally installed Debian and these work fine. I recently wanted to run...
1
by: Erik | last post by:
I understand, that PHP4 has a MySQL client built in. I was warned, that this client does not support the MySQL 4.1.1 system, which I installed on my RH9 box end that I need to install that version...
2
by: pancho | last post by:
Greetings, I need help configuring/building PHP3 with MySQL as a DSO on a Solaris 8 box - this module is needed to host some existing sites I will be migrating Note. I built PHP4 from source and...
3
by: Armin Irger | last post by:
Hi, i'am running a debian sarge with the delivered apache2 mysql and php4. The file "mitarbeiter_eingabe.php" gets the data over a html <FORM> and send it to...
3
by: Klaus Hansen | last post by:
Hi all Using Windows XP, PHP4.3.11 and Mysql 4.1. Im a newbie to PHP and Mysql. Im trying to connect to the database with this script: <?php //list_db.php
4
by: Andy Baxter | last post by:
hello, I'm using the php4-mysql module with php4 under debian linux (sarge). I have a script, schedule.php, which runs fine when I invoke it from the command line, but fails with the error: ...
0
by: John Oliver | last post by:
Fedora Core 2 server with httpd-2.0.54-10.2 php-4.3.10-2.4 php-mysql-4.3.10-2.4 It had MySQL 3.23.58.something on it, but the PHP websites were using a 4.something MySQL on another machine. I...
8
by: deko | last post by:
I've just loaded phpMyAdmin on a Debian Linux server with Apache2, MySql5 and PHP5. myserver # dpkg -l | grep php ii libapache-mod-php5 5.2.0-8+etch4 ii libapache2-mod-php4 4.4.4-8+etch2 ii...
3
by: doctorhardik | last post by:
hai all i am try configure php4.3.9 on my FC-3 machine. and my mysql database version 5.0.1, in phpinfo file it show mysql but when i run php -v command it show error like
11
by: Robin S. | last post by:
I've used phpinfo() to confirm settings for mySQL on our host server, and it's not returning accurate info. phpinfo() returns a mySQL client API version of 3.23.54 (uselss for me), where as a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.