midgard_config or how to create personal database in 2 minutes

Posted on 2007-02-27 23:07:18 EET.

Step 1.

Write simple php script, it may looks like this:

class my_config extends midgard_config {

}

$c = new my_config();
$c->dbtype = "SQLite";
$c->name = "midgard";
$c->save_file("MyData", TRUE);

What this script does is creating your own personal Midgard configuration. Second ( optional ) boolean parameter means "I want to write configuration in my home directory. Only there". 'MyData' is configuration name.

Step 2.

Write another script and it may looks like this:

mgd_config_init("MyData");

/* more own php code */

That's all. Your SQLite database is already created.

Stay tuned to learn more about "how can I create tables?" :)

Back

Layout Copyright © 2006 Finnish Teleservice Center Ltd Oy - Site Powered by Midgard CMS