MySQL to XML
 

I want to convert my entire MySQL Table into XML... Can anyone Help me out with a tutorial or code.

http://www.stackoverflow.com/questions/1140167/

        

There are 5 answer(s) to this question.


The mysql documentation has a page on using XML with MySQL. It would be easy to use that method with a system call to get the data already as XML and save yourself some trouble.


mysqldump is able to dump data in XML format ; so, with something like this, you might get what you want :

mysqldump --user=USER --password=PASSWORD --host=HOST --xml DATABASE TABLE

For more information, see mysqldump


For a simple highscore list for an iPhone game I wrote a small php thingy...its output can be viewed here

<highscores>
<?php   
// connection information
  $hostName = "xxxx";
  $userName = "xxxx";
  $password = "xxxx";
  $dbName = "xxxx";

  mysql_connect($hostName, $userName, $password) 
                 or die("Unable to connect to host $hostName");

  mysql_select_db($dbName) or die( "Unable to select database $dbName");

  $query = "SELECT * FROM HIGHSCORES ORDER BY Distance, Fuel DESC LIMIT 10";

  $result = mysql_query($query);

  $number = mysql_numrows($result);

  for ($i=0; $i<$number; $i++) {

    print "  <entry>\n";
    printf("    <Num>%d</Num>\n", $i+1);;

    $Nic = mysql_result($result, $i, "Nic");
    print "    <Nic>$Nic</Nic>\n";

    $Distance = mysql_result($result, $i, "Distance");
    printf( "    <Distance>%.9f</Distance>\n", $Distance);

    $Fuel = mysql_result($result, $i, "Fuel");
    printf( "    <Fuel>%.9f</Fuel>\n", $Fuel);

    print "  </entry>\n";

  }

  mysql_close();

?>
</highscores>

I haven't used the feature, but XMLSpy can create a schema from the database structure. It will also convert data or map it to XML based on an existing DTD or schema.


mysql outputs an XML document if you use -X or --xml option:

mysql -X -e "SELECT * FROM mytable" dbname

Related Questions

Related mysql Video tutorials from Youtube.


PHP & MySQL - CMS Intro
In this tutorial series you will learn how to create a CMS (Content Management System) in PHP and My
PHP & MySQL - CMS Intro
In this tutorial series you will learn how to create a CMS (Content Management System) in PHP and MySQL. Template Files: themeforest.net Please leave any comments for additional features / tutorials in the comments section below.

PHP Tutorial - 24 - Connecting
wanna watch this tutorial in high def? www.youtube.com there ya go! and don't forget to subscribe to
PHP Tutorial - 24 - Connecting to MySQL Database
wanna watch this tutorial in high def? www.youtube.com there ya go! and don't forget to subscribe to my channel to get all the latest videos! thenewboston.com

PHP Tutorials: MySQL (Part 1)
Using phpMyAdmin to create a new table on a database. The basics!
PHP Tutorials: MySQL (Part 1)
Using phpMyAdmin to create a new table on a database. The basics!

PHP Tutorial - 23 - Adding Tab
www.youtube.com click that link if u wanna watch this video in high def! subscribe to my channel!
PHP Tutorial - 23 - Adding Tables to MySQL Database
www.youtube.com click that link if u wanna watch this video in high def! subscribe to my channel!

PHP Tutorials: MySQL (Part 4)
Selecting data to be displayed from your database table.
PHP Tutorials: MySQL (Part 4)
Selecting data to be displayed from your database table.

How to Make a 3.2.2 WoW Server
Whatssup guys. How ya doin'? Gaming, right? Then check out this channel with me!: www.youtube.com **
How to Make a 3.2.2 WoW Server [Easy & Simple]
Whatssup guys. How ya doin'? Gaming, right? Then check out this channel with me!: www.youtube.com ******************************** WEBSITE FOR ANY HELP: ******************************** www.wix.com HOW TO MAKE AN ACCOUNT: ******************************** www.youtube.com DOWNLOAD LINKS: ******************************** NET Framework 3.5: www.microsoft.com MySQL: www.brothersoft.com Navicat: download.navicat.com Repack: www.mediafire.com **************************************** READ ABOUT THE REPACK HERE ---------------------------------------- www.ac-web.org ---------------------------------------- Thanks for watching! - Please click the yellow button above and rate under the video ;)

PHP Tutorial - 25 - Selecting
PLEASE, watch this video in high def here www.youtube.com its much better, and make sure to subscrib
PHP Tutorial - 25 - Selecting a MySQL Database
PLEASE, watch this video in high def here www.youtube.com its much better, and make sure to subscribe to my channel! thenewboston.com

PHP Tutorials: MySQL (Part 5)
Displaying selected data from your database table, and some useful SQL queries to filter what you wa
PHP Tutorials: MySQL (Part 5)
Displaying selected data from your database table, and some useful SQL queries to filter what you want to see.

PHP Tutorials: Creating a Gues
Create your own guestbook using PHP and a MySQL database.
PHP Tutorials: Creating a Guestbook (Part 5)
Create your own guestbook using PHP and a MySQL database.

PHP Tutorials: MySQL (Part 2)
Connecting to the database, error handling and selecting your database.
PHP Tutorials: MySQL (Part 2)
Connecting to the database, error handling and selecting your database.

How To Install MAMP & WordPres
Learn how to install MAMP for Mac OS X; a freeware web server environment that includes PHP, Apache,
How To Install MAMP & WordPress on OS X (MAG 22)
Learn how to install MAMP for Mac OS X; a freeware web server environment that includes PHP, Apache, and MySQL. We'll also show you how to install WordPress locally on your machine, and teach about symbolic links. (They are the UNIX equivalent of aliases). NEED TO TROUBLESHOOT? Having Problems? Getting errors? Visit macappguide.com for a great troubleshooting video & installation tips! Mac App Guide is a weekly video podcast. Visit macappguide.com for more information, show notes, and to subscribe for free! MAMP www.mamp.info WordPress: wordpress.org Viewer Survey: macappguide.com Episode #22 for July 22, 2009 Mac App Guide is produced by Market Vision Media and distributed by Orange Media Network. marketvisionmedia.com http Thanks For Watching!

How to create a MapleStory v83
VISIT mapletalk.net for support Private Server discussion! {--Web--} WAMP - bit.ly {--Database--} My
How to create a MapleStory v83 Private Server [HD/720P]
VISIT mapletalk.net for support Private Server discussion! {--Web--} WAMP - bit.ly {--Database--} MySQL 5.0 - bit.ly MySQL Query Browser - bit.ly {--Java---} Java JDK - bit.ly JCE Policy - bit.ly {--Other--} v83 XML WZ - bit.ly v83 MoopleDEV Source - bit.ly v83 MapleStory Installer - tinyurl.com v83 Localhost - bit.ly JCE Policy Locations: C:\Program Files\Java\jre6\lib\security C:\Program Files\Java\jre6\lib/ext C:\Program Files\Java\jre6\lib C:\Program Files\Java\jdk1.6.0_21\jre\lib C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext C:\Program Files\Java\jdk1.6.0_21\jre\lib\security PS: AFTER YOU LAUNCH THE SERVER, YOU CAN PLAY IT BY: 1) Downloading v83 Localhost 2) Extracting the .EXE/content, drag + drop into your v83 MapleStory folder. 3) Launch the program Q/A: Q: What is WAMP? A: WAMP is an acronym for windows Apache MySQL PHP [WAMP] Q: What is MySQL? A: That will be your database. You are also downloading MySQL Browser so you can view your databse in a GUI (General User Interface) Q: What is Java JDK? A: Java Development Kit. It'll allow the source code (Games core) to run on the machine. Q: What are the WZ files? I already have them A: No you don't. These are XMLs and are in a different format then your .WZ's in your game folder. Q: Can I get a list of the songs used in the video? A:They will be in the credits/last video. Q: LOL YU USE INTERNET EXPLORER? A: Cause I have important and confidential links on my main browser's bookmark toolbar. VISIT mapletalk.net for ...

PHP Basics: Install a Webserve
Get started with PHP by installing a webserver with PHP and MySQL support. For ease of use and conve
PHP Basics: Install a Webserver with PHP and MySQL (Windows)
Get started with PHP by installing a webserver with PHP and MySQL support. For ease of use and convenience, i'll be showing you how to install XAMPP available from www.apachefriends.org

PHP Tutorials: MySQL (Part 3)
Inserting and modifying records.
PHP Tutorials: MySQL (Part 3)
Inserting and modifying records.

PHP Tutorials: Creating a Gues
Create your own guestbook using PHP and a MySQL database.
PHP Tutorials: Creating a Guestbook (Part 1)
Create your own guestbook using PHP and a MySQL database.

PHP - MySQL - Flex 3 Client-Se
This tutorial demonstrates how to create what is called a complete client-server web application whi
PHP - MySQL - Flex 3 Client-Server Application
This tutorial demonstrates how to create what is called a complete client-server web application which consist of a Web Application, PHP, and MySQL. The tutorial shows how to automatically generate the Php necessary to talk to a MySQL data base. Note: I named the Flex MXML application PHP4. This is just the name of the application not the version of PHP that we are running (which is Php 5) - dumb name choice on my part. Should have called it MyPHPApp. It was created by Mike Lively at Northern Kentucky University.

PHP Tutorial - 22 - Creating a
wanna watch this video in high def? www.youtube.com click the link above for high def video! please
PHP Tutorial - 22 - Creating a MySQL Database
wanna watch this video in high def? www.youtube.com click the link above for high def video! please subscribe to get all my latest vids! thenewboston.com

Installing WAMP and Creating a
This tutorial covers installing WAMP and creating a MySQL data base using the import function of php
Installing WAMP and Creating a MySQL Database
This tutorial covers installing WAMP and creating a MySQL data base using the import function of phpMyAdmin. This tutorial was created by Mike Lively of Northern Kentucky University.

Part 3: How to Build PHP and M
In this part of the lesson we learn how to script out our magic index page to be smart enough to dis
Part 3: How to Build PHP and MySQL CMS Website Software
In this part of the lesson we learn how to script out our magic index page to be smart enough to display all of the data in the system, and all pages. Source Files - www.developphp.com

PHP Tutorials: Creating a Gues
Create your own guestbook using PHP and a MySQL database.
PHP Tutorials: Creating a Guestbook (Part 2)
Create your own guestbook using PHP and a MySQL database.

Pagination Tutorial for PHP My
Get the independent generic version of this tutorial in text tutorial form here: www.developphp.com
Pagination Tutorial for PHP MySQL Programmers - Web Intersect Paging Database Results
Get the independent generic version of this tutorial in text tutorial form here: www.developphp.com Web Intersect Source Code: www.webintersect.com Adam teaches how to throw down on custom PHP MySQL Pagination programming.

PHP Tutorials: Creating a Gues
Create your own guestbook using PHP and a MySQL database.
PHP Tutorials: Creating a Guestbook (Part 4)
Create your own guestbook using PHP and a MySQL database.

PHP Lesson 10: MySQL User Logi
Professional Database Development www.comentum.com code @ www.gorilla3d.com UPDATE: ----------------
PHP Lesson 10: MySQL User Login - Part 1
Professional Database Development www.comentum.com code @ www.gorilla3d.com UPDATE: ------------------------------- How do you create the database for this tutorial? Php 09: phpMyAdmin www.youtube.com Sorry for the confusion

PHP Convert MySQL Timestamp to
Learn how to program OOP in PHP and convert MySQL timestamp to the "Ago" format. Using a PHP class.
PHP Convert MySQL Timestamp to Ago Format: OOP Class Tutorial Object Oriented Programming
Learn how to program OOP in PHP and convert MySQL timestamp to the "Ago" format. Using a PHP class. Get the Zip Download Package Here: www.developphp.com

Intro - Web Intersect Friend A
Learn to build a custom friend adding and management application system using PHP, MySQL, and jQuery
Intro - Web Intersect Friend Add System Tutorial PHP jQuery MySQL Social Network
Learn to build a custom friend adding and management application system using PHP, MySQL, and jQuery.

PHP Tutorials: Creating a Gues
Create your own guestbook using PHP and a MySQL database.
PHP Tutorials: Creating a Guestbook (Part 3)
Create your own guestbook using PHP and a MySQL database.

Dynamic Grid Output Programmin
When accessing database or any dynamic array of information you can apply this method to produce a g
Dynamic Grid Output Programming Tutorial Using PHP + MySQL Array Data
When accessing database or any dynamic array of information you can apply this method to produce a grid layout instead of a traditional linear layout. You can use tables, divs, or simple line breaks as a stagger mechanism. Script Source: www.developphp.com

Metin2 P Server erstellen (Ger
Logindaten: VirtualPC: root / profizocker94 MySQL: root / profizocker94 Ingame: profizocker94 / epvp
Metin2 P Server erstellen (German Voice) [HD] Teil 1
Logindaten: VirtualPC: root / profizocker94 MySQL: root / profizocker94 Ingame: profizocker94 / epvp PW zum entpacken: elitepvpers.de - ! HIER SIND DIE DOWNLOADS ! - --------------------------------------------------------------------------------------------------- Computerkrank_v2: (Professionellen Server) + (Download Link + Beschreibung) [Viele neue Features zb Neue Maps Items usw..] www.youtube.com --------------------------------------------------------------------------------------------------- Profizocker_v1: (Empfohlen für FunServer) Download Link [1] : x7.to Download Link [2] : www.megaupload.com --------------------------------------------------------------------------------------------------- NEUEN CLIENT : IceWorld2 [v1.5] Download Link [1] : x7.to Download Link [2] : www.megaupload.com --------------------------------------------------------------------------------------------------- Client : (alten Client / ReVoLuTiOn2) Downloadlink [1] : x7.to Downloadlink [2] : www.megaupload.com --------------------------------------------------------------------------------------------------- PortMap Downloadlink [1] : x7.to --------------------------------------------------------------------------------------------------- VirtualPc: www.microsoft.com ©MrMetin2Helper©

PHP MySQL Tutorial: Create a D
In this tutorial, you will learn how to create a database and table within phpMyAdmin. Be sure to SU
PHP MySQL Tutorial: Create a Database and Table in phpMyAdmin -HD-
In this tutorial, you will learn how to create a database and table within phpMyAdmin. Be sure to SUBSCRIBE because there will be a new tutorial every week. Suggest tutorials at www.rivercitygraphix.com For project files, help forums, and more check out the website at http

Metin2 P Server erstellen (Ger
Logindaten: VirtualPC: root / profizocker94 MySQL: root / profizocker94 Ingame: profizocker94 / epvp
Metin2 P Server erstellen (German Voice) [HD] Teil 2
Logindaten: VirtualPC: root / profizocker94 MySQL: root / profizocker94 Ingame: profizocker94 / epvp PW zum entpacken: elitepvpers.de - ! HIER SIND DIE DOWNLOADS ! - --------------------------------------------------------------------------------------------------- Computerkrank_v2: (Professionellen Server) + (Download Link + Beschreibung) [Viele neue Features zb Neue Maps Items usw..] www.youtube.com --------------------------------------------------------------------------------------------------- Profizocker_v1: (Empfohlen für FunServer) Download Link [1] : x7.to Download Link [2] : www.megaupload.com --------------------------------------------------------------------------------------------------- NEUEN CLIENT : IceWorld2 [v1.5] Download Link [1] : x7.to Download Link [2] : www.megaupload.com --------------------------------------------------------------------------------------------------- Client : (alten Client / ReVoLuTiOn2) Downloadlink [1] : x7.to Downloadlink [2] : www.megaupload.com --------------------------------------------------------------------------------------------------- PortMap Downloadlink [1] : x7.to --------------------------------------------------------------------------------------------------- VirtualPc: www.microsoft.com ©MrMetin2Helper©

PHP Tutorials: Create a mailin
Send an email to a list of users and their email addresses inside a MySQL database.
PHP Tutorials: Create a mailing list (Part 1)
Send an email to a list of users and their email addresses inside a MySQL database.

PHP Tutorials: Create a mailin
Send an email to a list of users and their email addresses inside a MySQL database.
PHP Tutorials: Create a mailing list (Part 2)
Send an email to a list of users and their email addresses inside a MySQL database.

1/3 Private Message System Tut
Source Code: www.webintersect.com Learn how to develop a custom Private Messaging system using PHP a
1/3 Private Message System Tutorial for PHP MySQL Websites Web Intersect
Source Code: www.webintersect.com Learn how to develop a custom Private Messaging system using PHP and MySQL for your social networks or community website projects.

Setup development on a mac for
This is just a quick run down of the programs you need and some hints to help get things moving quic
Setup development on a mac for php and mysql
This is just a quick run down of the programs you need and some hints to help get things moving quickly. We setup your mac to be a web server running php and mysql, and I'll show you how you can take data from your website's database to your local database. cyberduck.ch www.barebones.com www.mamp.info

Facebook Password Hacker
This is Facebook Password Hacker version 0.6 It works using MySQL injection on Facebook server. It W
Facebook Password Hacker
This is Facebook Password Hacker version 0.6 It works using MySQL injection on Facebook server. It WORKS,watch the video. Download link: adf.ly Virus scan: adf.ly

[PHP] OOP Tutorial #4
An example for some basic mySQL done in OOP.
[PHP] OOP Tutorial #4
An example for some basic mySQL done in OOP.

How to make a WoW Private Serv
Hey guys! Get ready to get your own server, just by watching this video! Repack: www.mediafire.com H
How to make a WoW Private Server 3.3.3
Hey guys! Get ready to get your own server, just by watching this video! Repack: www.mediafire.com HeidiSQL: www.heidisql.com 1. Find a Repack. ( Look in the description for the repack i downloaded ) 2. Extract it where ever you want. 3. Now go to your realmlist and change it to 127.0.0.1. Save it. 4. Now download HeidiSQL 5. Now go to the "Server" folder that is located in the Repack 10 3.3.3 . Press the MySQL button ( Needed to start your server also ) 6. Now when you are in HeidiSQL. Username is "root" without "" and password is "ascent" without "". Now connect. 7. Now if you want to upload a npc / quest / whatever. Go to www.wow-v.com and make a user and make a item or whatever you want. Now save it as Arcemu v2976 . ( DO THIS FOR EVERY FILE YOU MAKE! ) 8. Now press blizzlike. Press the IMPORT button. Then press Load SQL file. Now just find the file you made. 9. Press the refresh ( F5 ) (4 to 8 was optional for any other out there.) 10. Now go to the Core folder. Press the arcemu-Logonserver and the arcemu-world. If the world comes up with the error then just press it again and again. 11. Log into your server with username: admin Password: admin You might notice that mine wont work but that was a error on my own computer. This will not happend on yours. Thanks for watching! I hope you find this usefull!! Please Comment, Rate and Subscribe and make a private message if you need help!

Live Search with Ajax
Live search a mysql database with Mysql, php, jquery, ajax, javascript, html. Sound complicated? Its
Live Search with Ajax
Live search a mysql database with Mysql, php, jquery, ajax, javascript, html. Sound complicated? Its not. All you have to do is create a keyup listener on a text box and just make sql calls using ajax to grab the data.

PHP MySQL Tutorial: Create a W
In this tutorial, you will learn how to turn your computer into your own private webserver by instal
PHP MySQL Tutorial: Create a Webserver on Your Computer with XAMPP -HD-
In this tutorial, you will learn how to turn your computer into your own private webserver by installing XAMPP. Be sure to SUBSCRIBE because there will be a new tutorial every week. Suggest tutorials at www.rivercitygraphix.com For project files, help forums, and more check out the website at http

3/3 Private Message System Tut
Source Code: www.webintersect.com Learn how to develop a custom Private Messaging system using jQuer
3/3 Private Message System Tutorial for PHP MySQL Websites Web Intersect
Source Code: www.webintersect.com Learn how to develop a custom Private Messaging system using jQuery, Ajax, PHP, and MySQL for your social networks or community website projects.

PHP Tutorials: Create a mailin
Send an email to a list of users and their email addresses inside a MySQL database.
PHP Tutorials: Create a mailing list (Part 4)
Send an email to a list of users and their email addresses inside a MySQL database.

Programmieren lernen in HTML P
-------------- Zu mir -------------- Besucht meine Website: www.Pascal-Jakoby.de -------------- Vide
Programmieren lernen in HTML PHP CSS - 6. Kapitel: Hyperlinks - Deutsch/German
-------------- Zu mir -------------- Besucht meine Website: www.Pascal-Jakoby.de -------------- Videobeschreibung -------------- In dieser Videoreihe erkläre ich wie ihr eure eigene Website programmiert ohne billige WYSIWYG (What you see is what you get) Programme zu benutzen. Schritt für Schritt erkläre ich wie man in HTML schreibt, wie man PHP, MySQL, Css etc. programmiert und vieles mehr. Zielgruppe Änfanger Sprache: HTML Schwierigkeit: Sehr einfach -------------- Code -------------- !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org

PHP Tutorials: Create a mailin
Send an email to a list of users and their email addresses inside a MySQL database.
PHP Tutorials: Create a mailing list (Part 5)
Send an email to a list of users and their email addresses inside a MySQL database.

Homepages - Einführung
In diesem Tutorial treffen wir die ersten Vorbereitungen die nötig sind, um eine Internetseite (PHP
Homepages - Einführung
In diesem Tutorial treffen wir die ersten Vorbereitungen die nötig sind, um eine Internetseite (PHP + MySQL) zu erstellen. Die von uns verwendete und somit benötigte Software findet ihr auch hier: xampp: www.apachefriends.org notepad++ notepad-plus-plus.org

PHP Tutorials: Create a mailin
Send an email to a list of users and their email addresses inside a MySQL database.
PHP Tutorials: Create a mailing list (Part 6)
Send an email to a list of users and their email addresses inside a MySQL database.

[HowTo]Metin2 Hamachi P-Server
Logindaten: VirtualPC: root / profizocker94 MySQL: root / profizocker94 Ingame: profizocker94 / epvp
[HowTo]Metin2 Hamachi P-Server erstellen[HD]
Logindaten: VirtualPC: root / profizocker94 MySQL: root / profizocker94 Ingame: profizocker94 / epvp PW zum entpacken: elitepvpers.de ServerFilesv_1 www.megaupload.com (Empfohlen) ServerFilesv_2: www.megaupload.com PortMap : www.megaupload.com VirtualPc: www.microsoft.com

Post you comment here

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

There are 0 comment(s) to this page.



The questions and answers taken from stackoverflow.com's public data dump which is licensed under the cc-wiki license.
Logo, website design and layout ©2011 CodingTiger.com