Rev Author Line No. Line
250 kaklik 1 <?php
2 /* $Id: db_details_common.inc.php,v 1.3 2006/01/14 23:17:16 cybot_tm Exp $ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4  
5 /**
6 * Gets some core libraries
7 */
8 require_once('./libraries/common.lib.php');
9 require_once('./libraries/bookmark.lib.php');
10  
11 PMA_checkParameters(array('db'));
12  
13 if ( PMA_MYSQL_INT_VERSION >= 50002 && $db == 'information_schema' ) {
14 $cfg['ShowStats'] = false;
15 $db_is_information_schema = true;
16 } else {
17 $db_is_information_schema = false;
18 }
19  
20 /**
21 * Defines the urls to return to in case of error in a sql statement
22 */
23 $err_url_0 = 'main.php?' . PMA_generate_common_url();
24 $err_url = $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db);
25  
26  
27 /**
28 * Ensures the database exists (else move to the "parent" script) and displays
29 * headers
30 */
31 if (!isset($is_db) || !$is_db) {
32 // Not a valid db name -> back to the welcome page
33 if (isset($db) && strlen($db)) {
34 $is_db = PMA_DBI_select_db($db);
35 }
36 if (!isset($db) || !strlen($db) || !$is_db) {
37 PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
38 exit;
39 }
40 } // end if (ensures db exists)
41  
42 /**
43 * Changes database charset if requested by the user
44 */
45 if (isset($submitcollation) && !empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) {
46 list($db_charset) = explode('_', $db_collation);
47 $sql_query = 'ALTER DATABASE ' . PMA_backquote($db) . ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
48 $result = PMA_DBI_query($sql_query);
49 $message = $strSuccess;
50 unset($db_charset, $db_collation);
51 }
52  
53 $js_to_run = 'functions.js';
54 require_once('./libraries/header.inc.php');
55  
56 /**
57 * Set parameters for links
58 */
59 $url_query = PMA_generate_common_url($db);
60  
61 ?>