Here is the structure and idea implemented
in my latest php database class.
I have learned a lot from follow txtSQL project by FarazAli.
Both what to do .. and what I do not want to do .. in my much more simple flatfile php db scripts.
So, my thanks goes very much to you, Ali!
======================================
MODEL.
1. Each database is a directory
2. Each table is only one (1) file, in db directory.
3. First line in table file describes the table.
4. Then follows all records, line by line.
EXAMPLE.
Here is contents of table file members.tb
- Code: Select all
6|¤|name|¤|lang|¤|age +LF(linefeed)
1|¤|John|¤|en|¤|22 +LF
2|¤|Eva|¤|de|¤|25 +LF
4|¤|Rickard|¤|de|¤|20 +LF
MORE INFO.
Here is an image, screenshot to explain the organisation of file content:
( this screenshot from my website may not work in future, but will for some time )
http://okay.mine.nu/downloads/phpmaster_datamodel_for_table_1.png
Here is dump table info function, $db->tbshow(), from one version of my class:
http://okay.mine.nu/downloads/dbclass-tbshow.png
These images are found in my public downloads directory:
http://okay.mine.nu/downloads/
==========================================
Any comments are welcome.
I will also try to answer any questions about my database.class.php
Regards, phpmaster
