PHP - MySQL - XML tutorial - basics

The educational technology and digital learning wiki
Jump to navigation Jump to search

Draft

This article or section is currently under construction

In principle, someone is working on it and there should be a better version in a not so distant future.
If you want to modify this page, please discuss it with the person working on it (see the "history")

Introduction

Objectives

XML is often used to transport data between applications. In this tutorial (once it's fully done) we shall see how to:

  • Store simple XML data (e.g. tabular data) in MySQL
  • Query a database with SQL, get the result in XML and render in HTML
Prerequisites
Remark

We don't plan to write a tutorial on how to store complex XML data in an SQL database, because it's a too difficult subject for educational technology or computer application students. We rather suggest to an XML database for that.

Rendering a database query with XSLT

This example shows PHP

Retrieving data as XML

Since SQL query results

Further explorations

Other tutorials

Sticking XML into a MysQL table

... to be written ...

Using libraries

Since sticking XML (in particular certain applications like RSS into MySQL and retrieving a result set as XML is a frequently encoutered problem, you also may consider various PHP libraries that do the job.

Example (none tested):