merge in branch for direct messaging integration by EMR Direct
[openemr.git] / library / adodb / tests / test-xmlschema.php
blob2d15c111be32d518314fa04050bf1a45acbe1d78
1 <?PHP
3 // V4.50 6 July 2004
5 error_reporting(E_ALL);
6 include_once( "../adodb.inc.php" );
7 include_once( "../adodb-xmlschema03.inc.php" );
9 // To build the schema, start by creating a normal ADOdb connection:
10 $db = ADONewConnection( 'mysql' );
11 $db->Connect( 'localhost', 'root', '', 'test' ) || die('fail connect1');
13 // To create a schema object and build the query array.
14 $schema = new adoSchema( $db );
16 // To upgrade an existing schema object, use the following
17 // To upgrade an existing database to the provided schema,
18 // uncomment the following line:
19 #$schema->upgradeSchema();
21 print "<b>SQL to build xmlschema.xml</b>:\n<pre>";
22 // Build the SQL array
23 $sql = $schema->ParseSchema( "xmlschema.xml" );
25 var_dump( $sql );
26 print "</pre>\n";
28 // Execute the SQL on the database
29 //$result = $schema->ExecuteSchema( $sql );
31 // Finally, clean up after the XML parser
32 // (PHP won't do this for you!)
33 //$schema->Destroy();
37 print "<b>SQL to build xmlschema-mssql.xml</b>:\n<pre>";
39 $db2 = ADONewConnection('mssql');
40 $db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
42 $db2->Execute("drop table simple_table");
44 $schema = new adoSchema( $db2 );
45 $sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
47 print_r( $sql );
48 print "</pre>\n";
50 $db2->debug=1;
52 foreach ($sql as $s)
53 $db2->Execute($s);