00001 <?PHP
00002
00003
00004
00005 error_reporting(E_ALL);
00006 include_once( "../adodb.inc.php" );
00007 include_once( "../adodb-xmlschema03.inc.php" );
00008
00009
00010 $db = ADONewConnection( 'mysql' );
00011 $db->Connect( 'localhost', 'root', '', 'schematest' );
00012
00013
00014 $schema = new adoSchema( $db );
00015
00016
00017
00018
00019 #$schema->upgradeSchema();
00020
00021 print "<b>SQL to build xmlschema.xml</b>:\n<pre>";
00022
00023 $sql = $schema->ParseSchema( "xmlschema.xml" );
00024
00025 print_r( $sql );
00026 print "</pre>\n";
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 print "<b>SQL to build xmlschema-mssql.xml</b>:\n<pre>";
00038
00039 $db2 = ADONewConnection('mssql');
00040 $db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
00041
00042 $db2->Execute("drop table simple_table");
00043
00044 $schema = new adoSchema( $db2 );
00045 $sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
00046
00047 print_r( $sql );
00048 print "</pre>\n";
00049
00050 $db2->debug=1;
00051
00052 foreach ($sql as $s)
00053 $db2->Execute($s);
00054 ?>