note 106610 added to book.simplexml
| From: | dj_inti007 at hotmail dot com | Date: | Tue, 22 Nov 2011 08:56:48 +0000 |
| Subject: | note 106610 added to book.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184615@lists.php.net to get a copy of this message | ||
Anyone please can help me out in giving me the code for archiving static data(for example playground
and matches already played) from sql and store it in xml file.
I make use of Query2XML but still it doesn't work
it display error and strict standard.
Here is the code i written.
<?php
// include required files
require_once 'XML/Query2XML.php';
require_once 'MDB2.php';
try {
// initalize Query2XML object
$q2x = XML_Query2XML::factory(MDB2::factory('mysql://root:pass@localhost/mis'));
// generate SQL query
// get results as XML
$sql = "SELECT * FROM footballmatches";
$xml = $q2x->getXML($sql, array(
'idColumn' => 'playground',
'rootTag' => 'matches',
'rowTag' => 'match',
'elements' => array('playground', 'opponent',
'date','time','homeAway','team','sponsor')
)
);
// send output to browser
header('Content-Type: text/xml');
$xml->formatOutput = true;
echo $xml->saveXML();
} catch (Exception $e) {
echo $e->getMessage();
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 41.136.226.30
----
Manual Page -- http://www.php.net/manual/en/book.simplexml.php
Edit -- https://master.php.net/note/edit/106610
Del: integrated -- https://master.php.net/note/delete/106610/integrated
Del: useless -- https://master.php.net/note/delete/106610/useless
Del: bad code -- https://master.php.net/note/delete/106610/bad+code
Del: spam -- https://master.php.net/note/delete/106610/spam
Del: non-english -- https://master.php.net/note/delete/106610/non-english
Del: in docs -- https://master.php.net/note/delete/106610/in+docs
Del: other reasons-- https://master.php.net/note/delete/106610
Reject -- https://master.php.net/note/reject/106610
Search -- https://master.php.net/manage/user-notes.php