Version 3.0.0




Adding To Database

xdd_add([DATABASE-FILE], [ENTRY-ID], [NEW-DATA])

[DATABASE-FILE]

Database File Path Location. This field should contain a relative path to either an existing database file, or one to be written. The name or extension of the file is a user choice. Many use .txt files or .db files.

[ENTRY-ID]

Entry identifier used to read, delete and replace entries. This string (text) can contain virtually any text. [ENTRY-ID] is formatted as <!--ID--> and prepended to the beginning of the file line.

[NEW-DATA]

This string should contain the contents of the storage data. Like [ENTRY-ID], virtually any text is usable within this field.



Making A New Database

Making a new database is simple. Just add an entry to the database you want to create. XDD will automatically create the file if it doesn't exist.



Adding To An Existing Database

If you already have established a database, adding to it is simple. Just use a XDD function call to add a new entry to the existing file. New entries are prepended to the top of the file above other entries. In this way, recently updated or added entries reside on top, and other entries reside below.



Database Formatting

As you may have already learned, XDD databases are based on file lines. This has proven to be a reliable technique for seperating different data entries. Since some data strings contain RETURN marks (You know, the enter key on a keyboard), without proper formatting, these databases could become corrupt (Data entry #1 could be split into multiple entries some without ID's).

To bypass this issue, XDD replaces all RETURN's (Both Linux And Windows RETURN's) with a system recognized tag ( <!--XD_RETURN--> ). This way, all entries, no matter how many lines they may contain, only use one line within the database file. But, don't worry, when you use XDD to read the entry, RETURN's will be added. For full compatibility, both Linux and Windows are converted into Linux RETURN's. This may have some odd side effects for Windows users. The most notable, is some incompatibility with MS Notepad. But Wordpad works just great, and many other editors too.



Example Usage:


These are some examples on the usage of this function. You can use these examples as templates for your own application, or in unison with the information above to learn more.


Add "Hello How Are You Doing?" to "database.db" with the ID "Greeting"
<?php
xdd_add("database.db", "Greeting", "Hello How Are You Doing?");
?>


Add "Hello How Are You Doing?" to "databases/database.db" with the ID "Greeting"
<?php
xdd_add("databases/database.db", "Greeting", "Hello How Are You Doing?");
?>
Copyright © XegmentDelta And Respective Owners.
Processed: 0.24 Sec | 778,496 Hits | 11 Users Online
Website Design & Implementation By D3xt3r
XegmentDelta Network Powered By X.D.D and ChemicalServers