Implement dynamic XML

xiaoxiao2021-03-06  81

Implement dynamic XML

First built table: CREATE TABLE books (bookid int (4) NOT NULL auto_increment, bookname varchar (100) NOT NULL, bookauth varchar (50) NOT NULL, bookpublisher varchar (50) NOT NULL, bookpubdate datetime NOT NULL, bookurl varchar (50 NOT NULL, Key BookId (BookID), then. . . This section is the source code to XML from MySQL to XML: n "; $ XMLFILE. = " n"; while ($ rs)) {for ($ I = 0; $ i <$ numfields; $ i ) {$ FIELDNAME = mysql_field_name ($ RS, $ I) ); $ Xmlfile. = "<" $ Fieldname. ">" $ Row [$ I]. " N";}} mysql_free_result ($ r); mysql_close ($ connect_id) $ Xmlfile. = " n"; $ fp = fopen ("XmLDoc / XmLDoc.xml", "W"); if (fwrite ($ fp, $ xmlfile) {echo "writes the file success! "} Else {echo" write file failed! ";}?> This is the source code that is transformed into HTML from XML. . .

转载请注明原文地址:https://www.9cbs.com/read-105257.html

New Post(0)