commit
c828f7aedd
50
Home.md
Normal file
50
Home.md
Normal file
@ -0,0 +1,50 @@
|
||||
# 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
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Database>
|
||||
<table name="table1">
|
||||
<item id="clock">
|
||||
<visibility>false</visibility>
|
||||
<x>950</x>
|
||||
<y>42</y>
|
||||
</item>
|
||||
<item id="weather">
|
||||
<visibility>true</visibility>
|
||||
<city>Paris</city>
|
||||
<x>605</x>
|
||||
<y>648</y>
|
||||
</item>
|
||||
</table>
|
||||
<table name="table2">
|
||||
<item id="clockAdvanced">
|
||||
<visibility>false</visibility>
|
||||
<x>80</x>
|
||||
<y>10</y>
|
||||
<fontFamily>Times New Roman, serif</fontFamily>
|
||||
<fontSize>20px</fontSize>
|
||||
<format>%A %d %B %Y - %H:%M:%S</format>
|
||||
<color>#000</color>
|
||||
</item>
|
||||
</table>
|
||||
</Database>
|
||||
```
|
||||
|
||||
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 !) )
|
Loading…
Reference in New Issue
Block a user