home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / test-xmlschema.php < prev    next >
Encoding:
PHP Script  |  2004-03-20  |  892 b   |  34 lines

  1. <?PHP
  2.  
  3. // V4.21 20 Mar 2004
  4.  
  5. error_reporting(E_ALL);
  6.  
  7. require( "../adodb-xmlschema.inc.php" );
  8.  
  9. // To build the schema, start by creating a normal ADOdb connection:
  10. $db = ADONewConnection( 'mysql' );
  11. $db->Connect( 'localhost', 'root', '', 'schematest' );
  12.  
  13. // To create a schema object and build the query array.
  14. $schema = new adoSchema( $db );
  15.  
  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();
  20.  
  21. // Build the SQL array
  22. $sql = $schema->ParseSchema( "xmlschema.xml" );
  23.  
  24. print "Here's the SQL to do the build:\n<pre>";
  25. print_r( $sql );
  26. print "</pre>\n";
  27.  
  28. // Execute the SQL on the database
  29. //$result = $schema->ExecuteSchema( $sql );
  30.  
  31. // Finally, clean up after the XML parser
  32. // (PHP won't do this for you!)
  33. //$schema->Destroy();
  34. ?>