home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phptriad / phptriad2-2-1.exe / htdocs / phpmyadmin / db_create.php < prev    next >
PHP Script  |  2002-01-06  |  973b  |  46 lines

  1. <?php
  2. /* $Id: db_create.php,v 1.14 2001/11/23 01:03:19 loic1 Exp $ */
  3.  
  4.  
  5. /**
  6.  * Gets some core libraries
  7.  */
  8. require('./libraries/grab_globals.lib.php');
  9. $js_to_run = 'functions.js';
  10. require('./header.inc.php');
  11.  
  12.  
  13. /**
  14.  * Defines the url to return to in case of error in a sql statement
  15.  */
  16. $err_url = 'main.php'
  17.          . '?lang=' . $lang
  18.          . '&server=' . $server;
  19.  
  20.  
  21. /**
  22.  * Ensures the db name is valid
  23.  */
  24. if (get_magic_quotes_gpc()) {
  25.     $db      = stripslashes($db);
  26. }
  27. if (PMA_MYSQL_INT_VERSION < 32306) {
  28.     PMA_checkReservedWords($db, $err_url);
  29. }
  30.  
  31.  
  32. /**
  33.  * Executes the db creation sql query
  34.  */
  35. $local_query = 'CREATE DATABASE ' . PMA_backquote($db);
  36. $result      = mysql_query('CREATE DATABASE ' . PMA_backquote($db)) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
  37.  
  38.  
  39. /**
  40.  * Displays the result and moves back to the calling page
  41.  */
  42. $message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
  43. require('./db_details.php');
  44.  
  45. ?>
  46.