3 Home
Shikiryu edited this page 2019-10-21 09:36:23 +02:00

PHP XML Database Class

The goal of this project is to get a PHP class managing a database in XML format as it would be in MySQL (but with less options obviously)

Database Format

<?xml version="1.0" encoding="utf-8"?>
    <table name="table1">
        <item id="clock">
        <item id="weather">
    <table name="table2">
        <item id="clockAdvanced">
            <fontFamily>Times New Roman, serif</fontFamily>
            <format>%A %d %B %Y - %H:%M:%S</format>

As you can see, the XML contains only one Database but an infinite (well, not that much ;) ) number of Tables with a unique name and in which you can have items that could be compared to rows in MySQL. The differences are :

  • In a table, you can have items with different attributes as you can see in table1
  • Attributes can't have different formats (for now). Everything is a @string@. Of course, you can convert them later.
  • You can move items from table to table! You could even move them to a precise location into your file!

"SQL" command syntax

  • Data definition (like Create Database, Drop Database, Create Table, Drop Table )
  • Data manipulation (like Insert, Delete, Update, Select, Move (experimental, only with XMLDB !) )