PHP Classes

File: examples/createtable.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of philippe thomassigny  >  Dominion  >  examples/createtable.php  >  Download  
File: examples/createtable.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Dominion
Build and execute portable SQL queries
Author: By
Last change: patch 8.00.05
Date: 3 years ago
Size: 1,256 bytes


Class file image Download

// We assure any Dominion library we call will be automatically loaded
include_once '../include/__autoload.lib';

define ('WADEBUG', false);

echo <<<EOF
If you get an exception, you should edit db.php to fix the database type,<br />
database name, username and password of the database you are going to use<br />
to test the examples.<br /><br />

// Load the instances

echo "Loading the instances...<br />";

require 'config/country.php';
require 'config/language.php';
require 'config/citizen.php';
// Create the tables

echo "Creating the 3 tables...<br />";




// fill the tables

echo "Filling the 3 tables...<br />";

$BASE_country = new DB_Table('./config/country.xml');

DB_TableExport::export('./data/tables/country.xml', $BASE_country);
DB_TableExport::exportDefinition('./data/tables/countrytest.xml', $BASE_country);

DB_TableImport::import('./data/tables/country.xml', $BASE_country);

echo "Done.<br />";