charset patch

This commit is contained in:
Marc Delisle
2002-06-14 12:07:18 +00:00
parent ea0f5f5a9a
commit 9bd9a44a67
103 changed files with 1025 additions and 378 deletions

View File

@@ -1053,6 +1053,33 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
<br /><br />
</dd>
<dt><b>$cfg['DefaultCharset'] </b>string</dt>
<dd>
Default charset to use for recoding of MySQL queries. This must be
enabled and it's described by $cfg['AllowAnywhereRecoding'] option.
You can give here any charset which is in $cfg['AvailableCharsets']
array and this is just default choice, user can select any of them.
<br /><br />
</dd>
<dt><b>$cfg['AllowAnywhereRecoding'] </b>string</dt>
<dd>
Allow charset recoding of MySQL queries. You need recode or iconv
support (compiled in or module) in php to allow MySQL queries recoding
and used language file must have it enabled (by default only these
which are in unicode, just to avoid losing some characters).
<br /><br />
</dd>
<dt><b>$cfg['AvailableCharsets'] </b>array</dt>
<dd>
Available charsets for MySQL conversion. You can add your own (any of
supported by recode/iconv) or remove these which you don't use.
Charsets will be shown in same order as here listed, so if you
frequently use some of these move them to the top.
<br /><br />
</dd>
<dt><b>$cfg['LeftWidth'] </b>integer</dt>
<dd>
Left frame width in pixel.

View File

@@ -192,6 +192,16 @@ $cfg['ManualBaseShort'] = 'http://www.mysql.com/doc';
*/
// Default language to use, if not browser-defined or user-defined
$cfg['DefaultLang'] = 'en';
/**
* Charset conversion settings
*/
// Default charset to use for recoding of MySQL queries
// (see $cfg['AvailableCharsets'] to possible choices, you can add your own)
$cfg['DefaultCharset'] = 'iso-8859-2';
// Allow charset recoding of MySQL queries, must be also enabled in language
// file to make harder using other language files than unicode.
$cfg['AllowAnywhereRecoding'] = TRUE;
// Force: always use this language - must be defined in
// libraries/select_lang.lib.php3
// $cfg['Lang'] = 'en';
@@ -237,6 +247,45 @@ $cfg['colorStrings'] = '#008000';
$cfg['colorColType'] = '#FF9900';
$cfg['colorAdd'] = '#0000FF';
/**
* Available charsets for MySQL conversion. currently contains all which could
* be found in lang/* files and few more.
*
* Charsets will be shown in same order as here listed, so if you frequently
* use some of these move them to the top.
*/
$cfg['AvailableCharsets'] = array(
'iso-8859-1',
'iso-8859-2',
'iso-8859-3',
'iso-8859-4',
'iso-8859-5',
'iso-8859-6',
'iso-8859-7',
'iso-8859-8',
'iso-8859-9',
'iso-8859-10',
'iso-8859-11',
'iso-8859-12',
'iso-8859-13',
'iso-8859-14',
'iso-8859-15',
'windows-1250',
'windows-1251',
'windows-1252',
'windows-1257',
'koi8-r',
'big5',
'gb2312',
'utf-8',
'utf-7',
'x-user-defined',
'euc-jp',
'ks_c_5601-1987',
'tis-620',
'SHIFT_JIS'
);
/**
* MySQL settings

View File

@@ -15,6 +15,7 @@ require('./header.inc.php3');
*/
$err_url = 'main.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server;
@@ -33,7 +34,7 @@ if (PMA_MYSQL_INT_VERSION < 32306) {
* Executes the db creation sql query
*/
$local_query = 'CREATE DATABASE ' . PMA_backquote($db);
$result = mysql_query('CREATE DATABASE ' . PMA_backquote($db)) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
$result = PMA_mysql_query('CREATE DATABASE ' . PMA_backquote($db)) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
/**

View File

@@ -57,6 +57,7 @@ $is_upload = (PMA_PHP_INT_VERSION >= 40000 && function_exists('ini_get'))
onsubmit="return checkSqlQuery(this)">
<input type="hidden" name="is_js_confirmed" value="0" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="pos" value="0" />

View File

@@ -15,9 +15,11 @@ require('./libraries/bookmark.lib.php3');
*/
$err_url_0 = 'main.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server;
$err_url = 'db_details.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
@@ -29,10 +31,10 @@ $err_url = 'db_details.php3'
if (!isset($is_db) || !$is_db) {
// Not a valid db name -> back to the welcome page
if (!empty($db)) {
$is_db = @mysql_select_db($db);
$is_db = @PMA_mysql_select_db($db);
}
if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
}
} // end if (ensures db exists)
@@ -47,7 +49,7 @@ if (!isset($message)) {
?>
<script type="text/javascript" language="javascript1.2">
<!--
window.parent.frames['nav'].location.replace('./left.php3?lang=<?php echo $lang; ?>&server=<?php echo $server; ?>&db=<?php echo urlencode($db); ?>');
window.parent.frames['nav'].location.replace('./left.php3?lang=<?php echo $lang; ?> &convcharset=<?php echo $convcharset; ?>&server=<?php echo $server; ?>&db=<?php echo urlencode($db); ?>');
//-->
</script>
<?php
@@ -62,6 +64,7 @@ window.parent.frames['nav'].location.replace('./left.php3?lang=<?php echo $lang;
* Set parameters for links
*/
$url_query = 'lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);

View File

@@ -11,10 +11,10 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
// Special speedup for newer MySQL Versions (in 4.0 format changed)
if ($cfg['SkipLockedTables'] == TRUE && PMA_MYSQL_INT_VERSION >= 32330) {
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
// Blending out tables in use
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($tmp = mysql_fetch_row($result)) {
while ($tmp = PMA_mysql_fetch_row($result)) {
// if in use memorize tablename
if (eregi('in_use=[1-9]+', $tmp[1])) {
$sot_cache[$tmp[0]] = TRUE;
@@ -24,13 +24,13 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
if (isset($sot_cache)) {
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($tmp = mysql_fetch_row($result)) {
while ($tmp = PMA_mysql_fetch_row($result)) {
if (!isset($sot_cache[$tmp[0]])) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\'';
$sts_result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$sts_tmp = mysql_fetch_array($sts_result);
$sts_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$sts_tmp = PMA_mysql_fetch_array($sts_result);
$tables[] = $sts_tmp;
} else { // table in use
$tables[] = array('Name' => $tmp[0]);
@@ -44,9 +44,9 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
}
if (!isset($sot_ready)) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($sts_tmp = mysql_fetch_array($result)) {
while ($sts_tmp = PMA_mysql_fetch_array($result)) {
$tables[] = $sts_tmp;
}
mysql_free_result($result);
@@ -55,10 +55,10 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
$num_tables = (isset($tables) ? count($tables) : 0);
} // end if (PMA_MYSQL_INT_VERSION >= 32303)
else {
$result = mysql_list_tables($db);
$result = PMA_mysql_list_tables($db);
$num_tables = ($result) ? @mysql_numrows($result) : 0;
for ($i = 0; $i < $num_tables; $i++) {
$tables[] = mysql_tablename($result, $i);
$tables[] = PMA_mysql_tablename($result, $i);
}
mysql_free_result($result);
}

View File

@@ -17,8 +17,8 @@ else {
// Drop link if allowed
if (!$cfg['AllowUserDropDatabase']) {
// Check if the user is a Superuser
$result = @mysql_query('USE mysql');
$cfg['AllowUserDropDatabase'] = (!mysql_error());
$result = @PMA_mysql_query('USE mysql');
$cfg['AllowUserDropDatabase'] = (!PMA_mysql_error());
}
if ($cfg['AllowUserDropDatabase']) {
$lnk5 = '<a href="sql.php3?' . $url_query . '&amp;sql_query='

View File

@@ -42,6 +42,7 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
?>
<form method="post" action="db_details_structure.php3" name="tablesForm">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
@@ -252,6 +253,7 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
// Check all tables url
$checkall_url = 'db_details_structure.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
echo "\n";
@@ -304,6 +306,7 @@ else {
?>
<form action="db_details_structure.php3">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
@@ -363,6 +366,7 @@ else {
// Check all tables url
$checkall_url = 'db_details_structure.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
?>
@@ -422,6 +426,7 @@ if ($num_tables > 0) {
onsubmit="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', 1))">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<?php
echo ' ' . sprintf($strCreateNewTable, htmlspecialchars($db)) . '&nbsp;:<br />' . "\n";
@@ -450,21 +455,22 @@ if (!empty($cfg['Server']['table_coords'])
<!-- PDF schema -->
<?php
// We only show this if we find something in the new pdf_pages table
@mysql_select_db($db);
@PMA_mysql_select_db($db);
$test_query = 'SELECT * FROM ' . PMA_backquote($cfg['Server']['pdf_pages']);
$test_rs = mysql_query($test_query) or PMA_mysqlDie('', $test_query, '', $err_url_0);
$test_rs = PMA_mysql_query($test_query) or PMA_mysqlDie('', $test_query, '', $err_url_0);
if(mysql_num_rows($test_rs) > 0){
?>
<li>
<form method="post" action="pdf_schema.php3">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<?php echo $strDisplayPDF; ?>&nbsp;:<br />
<?php echo $strPageNumber; ?>&nbsp;
<select name="pdf_page_number">
<?php
while ($pages = @mysql_fetch_array($test_rs)) {
while ($pages = @PMA_mysql_fetch_array($test_rs)) {
echo '<option value="'.$pages['page_nr'].'">'.$pages['page_nr'].': '.$pages['page_descr'].'</option>'."\n";
}
?>

View File

@@ -14,6 +14,7 @@ require('./header.inc.php3');
*/
$err_url = 'db_details.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
@@ -27,10 +28,10 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
// Special speedup for newer MySQL Versions (in 4.0 format changed)
if ($cfg['SkipLockedTables'] == TRUE && PMA_MYSQL_INT_VERSION >= 32330) {
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
$result = mysql_query($query) or PMA_mysqlDie('', $local_query, '', $err_url);
$result = PMA_mysql_query($query) or PMA_mysqlDie('', $local_query, '', $err_url);
// Blending out tables in use
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($tmp = mysql_fetch_array($result)) {
while ($tmp = PMA_mysql_fetch_array($result)) {
// if in use memorize tablename
if (eregi('in_use=[1-9]+', $tmp)) {
$sot_cache[$tmp[0]] = TRUE;
@@ -40,13 +41,13 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
if (isset($sot_cache)) {
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
$result = mysql_query($query) or PMA_mysqlDie('', $local_query, '', $err_url);
$result = PMA_mysql_query($query) or PMA_mysqlDie('', $local_query, '', $err_url);
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($tmp = mysql_fetch_array($result)) {
while ($tmp = PMA_mysql_fetch_array($result)) {
if (!isset($sot_cache[$tmp[0]])) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\'';
$sts_result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$sts_tmp = mysql_fetch_array($sts_result);
$sts_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$sts_tmp = PMA_mysql_fetch_array($sts_result);
$tables[] = $sts_tmp;
} else { // table in use
$tables[] = array('Name' => $tmp[0]);
@@ -60,9 +61,9 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
}
if (!isset($sot_ready)) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($sts_tmp = mysql_fetch_array($result)) {
while ($sts_tmp = PMA_mysql_fetch_array($result)) {
$tables[] = $sts_tmp;
}
mysql_free_result($result);
@@ -71,10 +72,10 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
$num_tables = (isset($tables) ? count($tables) : 0);
} // end if (PMA_MYSQL_INT_VERSION >= 32303)
else {
$result = mysql_list_tables($db);
$result = PMA_mysql_list_tables($db);
$num_tables = ($result) ? @mysql_numrows($result) : 0;
for ($i = 0; $i < $num_tables; $i++) {
$tables[] = mysql_tablename($result, $i);
$tables[] = PMA_mysql_tablename($result, $i);
}
mysql_free_result($result);
}

View File

@@ -20,10 +20,10 @@ $url_query .= '&amp;goto=db_search.php3';
/**
* Get the list of tables from the current database
*/
$list_tables = mysql_list_tables($db);
$list_tables = PMA_mysql_list_tables($db);
$num_tables = ($list_tables ? mysql_num_rows($list_tables) : 0);
for ($i = 0; $i < $num_tables; $i++) {
$tables[] = mysql_tablename($list_tables, $i);
$tables[] = PMA_mysql_tablename($list_tables, $i);
}
if ($num_tables) {
mysql_free_result($list_tables);
@@ -64,10 +64,10 @@ if (isset($submit_search)) {
// Fields to select
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($table);
$res = @mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
$res = @PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
$res_cnt = ($res ? mysql_num_rows($res) : 0);
for ($i = 0; $i < $res_cnt; $i++) {
$tblfields[] = PMA_backquote(mysql_result($res, $i, 'field'));
$tblfields[] = PMA_backquote(PMA_mysql_result($res, $i, 'field'));
} // end if
$sqlstr_fieldstoselect = ' ' . implode(', ', $tblfields);
$tblfields_cnt = count($tblfields);
@@ -189,6 +189,7 @@ if (isset($submit_search)) {
<form method="post" action="sql.php3" name="db_search_results_form">
<input type="hidden" name="is_js_confirmed" value="0" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="goto" value="db_details.php3" />
@@ -206,9 +207,9 @@ if (isset($submit_search)) {
// Executes the "COUNT" statement
$local_query = $newsearchsqls['select_count'];
$res = @mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
$res = @PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
if ($res) {
$res_cnt = mysql_result($res, 0, 'count');
$res_cnt = PMA_mysql_result($res, 0, 'count');
mysql_free_result($res);
} else {
$res_cnt = 0;
@@ -240,9 +241,9 @@ if (isset($submit_search)) {
// Executes the "COUNT" statement
$local_query = $newsearchsqls['select_count'];
$res = @mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
$res = @PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
if ($res) {
$res_cnt = mysql_result($res, 0, 'count');
$res_cnt = PMA_mysql_result($res, 0, 'count');
mysql_free_result($res);
} else {
$res_cnt = 0;
@@ -310,6 +311,7 @@ if (empty($search_option)) {
<a name="db_search"></a>
<form method="post" action="db_search.php3" name="db_search">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />

View File

@@ -12,7 +12,7 @@ require('./header.inc.php3');
/**
* Ensures the current user is super-user
*/
if (!@mysql_query('USE mysql', $userlink)) {
if (!@PMA_mysql_query('USE mysql', $userlink)) {
echo '<p><b>' . $strError . '</b></p>' . "\n";
echo '<p>&nbsp;&nbsp;&nbsp;&nbsp;' . $strNoRights . '</p>' . "\n";
include('./footer.inc.php3');
@@ -27,6 +27,7 @@ if ((!empty($submit_mult) && isset($selected_db))
|| isset($mult_btn)) {
$err_url = 'db_stats.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server;
$action = 'db_stats.php3';
$show_query = 'y';
@@ -82,7 +83,7 @@ if ($server > 0) {
// Get the valid databases list
$num_dbs = count($dblist);
$dbs = @mysql_list_dbs() or PMA_mysqlDie('', 'mysql_list_dbs()', '', 'main.php3?lang' . $lang . '&amp;server=' . $server);
while ($a_db = mysql_fetch_object($dbs)) {
while ($a_db = PMA_mysql_fetch_object($dbs)) {
if (!$num_dbs) {
$dblist[] = $a_db->Database;
} else {
@@ -140,7 +141,7 @@ if ($server > 0) {
*/
if ($num_dbs > 0) {
// Defines the urls used to sort the table
$common_url = 'db_stats.php3?lang=' . $lang . '&amp;server=' . $server;
$common_url = 'db_stats.php3?lang=' . $lang . '&amp;server=' . $server . '&amp;convcharset=' . $convcharset;
if (empty($sort_by)) {
$sort_by = 'db_name';
$sort_order = 'asc';
@@ -182,6 +183,7 @@ if ($num_dbs > 0) {
?>
<form action="db_stats.php3" name="dbStatsForm">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<table align="center" border="<?php echo $cfg['Border']; ?>">
@@ -225,7 +227,7 @@ if ($num_dbs > 0) {
// Gets the tables stats per database
for ($i = 0; $i < $num_dbs; $i++) {
$db = $dblist[$i];
$tables = @mysql_list_tables($db);
$tables = @PMA_mysql_list_tables($db);
// Number of tables
$dbs_array[$db][0] = ($tables) ? @mysql_numrows($tables) : 0;
@@ -239,10 +241,10 @@ if ($num_dbs > 0) {
if (PMA_MYSQL_INT_VERSION >= 32303) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
$result = @mysql_query($local_query);
$result = @PMA_mysql_query($local_query);
// needs the "@" below otherwise, warnings in case of special DB names
if ($result && @mysql_num_rows($result)) {
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
$dbs_array[$db][1] += $row['Data_length'];
$dbs_array[$db][2] += $row['Index_length'];
}
@@ -264,6 +266,7 @@ if ($num_dbs > 0) {
// Check/unchek all databases url
$checkall_url = 'db_stats.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. (empty($sort_by) ? '' : '&amp;sort_by=' . $sort_by)
. (empty($sort_order) ? '' : '&amp;sort_order=' . $sort_order);
@@ -284,7 +287,7 @@ if ($num_dbs > 0) {
echo ' <td align="center" bgcolor="'. $bgcolor . '">' . "\n";
echo ' &nbsp;<input type="checkbox" name="selected_db[]" value="' . urlencode($db_name) . '"' . $do_check . ' />&nbsp;' . "\n";
echo ' </td>' . "\n";
echo ' <td bgcolor="'. $bgcolor . '">&nbsp;<a href="index.php3?lang=' . $lang . '&amp;server=' . $server . '&amp;db=' . urlencode($db_name) . '" target="_parent">' . htmlentities($db_name) . '</a>&nbsp;</td>' . "\n";
echo ' <td bgcolor="'. $bgcolor . '">&nbsp;<a href="index.php3?lang=' . $lang . '&amp;server=' . $server . '&amp;db=' . urlencode($db_name) . '&amp;convcharset=' . $convcharset . '" target="_parent">' . $db_name . '</a>&nbsp;</td>' . "\n";
echo ' <td align="right" bgcolor="'. $bgcolor . '">&nbsp;' . $dbs_array[$db_name][0] . '&nbsp;</td>' . "\n";
echo ' <td align="right" bgcolor="'. $bgcolor . '">&nbsp;' . $data_size . '<bdo dir="' . $text_dir . '"> </bdo>' . $data_unit . '&nbsp;</td>' . "\n";
echo ' <td align="right" bgcolor="'. $bgcolor . '">&nbsp;' . $idx_size . '<bdo dir="' . $text_dir . '"> </bdo>' . $idx_unit . '&nbsp;</td>' . "\n";

View File

@@ -179,6 +179,7 @@ if ($cfg['RightBgImage'] != '') echo '" background="' . $cfg['RightBgImage'];
<?php
if (isset($db)) {
$header_url_qry = '?lang=' . urlencode($lang)
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server;
echo '<h1>' . "\n";
echo ' ' . $strDatabase . ' <i><a class="h1" href="db_details.php3' . $header_url_qry . '&amp;db=' . urlencode($db) . '">' . htmlspecialchars($db) . '</a></i>' . "\n";

View File

@@ -38,6 +38,7 @@ if (isset($lightm_db)) {
unset($lightm_db);
}
$url_query = 'lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. (empty($db) ? '' : '&amp;db=' . urlencode($db));
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -401,4 +401,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -399,4 +399,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -395,4 +395,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -402,4 +402,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -402,4 +402,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -394,4 +394,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -397,4 +397,7 @@ $strZip = '"Gezipt"';
// To translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -393,4 +393,7 @@ $strYes = 'Yes';
$strZip = '"zipped"';
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -395,4 +395,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -399,4 +399,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -394,4 +394,7 @@ $strZip = '"zipp
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -399,4 +399,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -404,4 +404,7 @@ $strPrimaryKeyWarning = '("PRIMARY" <b>must</b> be the name of and <b>only of</b
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -401,4 +401,7 @@ $strYes = 'Ja';
$strZip = 'Zip komprimiert';
$strHaveToShow = 'Bitte w<>hlen Sie mindestens eine anzuzeigende Spalte';
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -396,4 +396,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -395,4 +395,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -398,4 +398,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -397,4 +397,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -401,4 +401,7 @@ $strZip = '"compresso con zip"';
// To translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -405,4 +405,7 @@ $strXkana = '
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -404,4 +404,7 @@ $strXkana = '
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -396,4 +396,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -399,4 +399,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -396,4 +396,7 @@ $strReferentialIntegrity = 'Check referential integrity:';
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -398,4 +398,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -396,4 +396,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -402,4 +402,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -396,4 +396,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -400,4 +400,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -401,4 +401,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -399,4 +399,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -398,4 +398,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -393,4 +393,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -395,4 +395,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -405,4 +405,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -395,4 +395,7 @@ $strStructPropose = 'Propose table structure'; // just no translation for
$strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br />This might happen if php finds a parse error in it or php cannot find the file.<br />Please call the configuration file directly using the link below and read the php error message(s) that you recieve. In most cases a quote or a semicolon is missing somewhere.<br />If you recieve a blank page, everything is fine.'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -395,4 +395,7 @@ $strConfigFileError = 'phpMyAdmin was unable to read your configuration file!<br
$strNotSet = '<b>%s</b> table not found or not set in %s'; //to translate
$strMissingBracket = 'Missing Bracket'; //to translate
$strHaveToShow = 'You have to choose at least one Column to display'; //to translate
$strCantLoadRecodeIconv = 'Can not load iconv or recode extension needed for charset conversion, configure php to allow using these extensions or disable charset conversion in phpMyAdmin.'; //to translate
$strCantUseRecodeIconv = 'Can not use iconv nor libiconv nor recode_string function while extension reports to be loaded. Check your php configuration.'; //to translate
$strMySQLCharset = 'MySQL Charset'; //to translate
?>

View File

@@ -77,6 +77,7 @@ if (function_exists('PMA_set_enc_form')) {
<tr>
<td colspan="3" align="center">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />

View File

@@ -167,8 +167,7 @@ echo "\n";
<body bgcolor="<?php echo $cfg['LeftBgColor']; ?>">
<!-- Link to the welcome page -->
<div id="el1Parent" class="parent" style="margin-bottom: 5px">
<nobr><a class="item" href="main.php3?lang=<?php echo $lang; ?>&amp;server=<?php echo $server; ?>">
<span class="heada"><b><?php echo $strHome; ?></b></span></a></nobr>
<nobr><a class="item" href="main.php3?lang=<?php echo $lang; ?>&amp;server=<?php echo $server; ?>&amp;convcharset=<?php echo $convcharset;?>"><span class="heada"><b><?php echo $strHome; ?></b></span></a></nobr>
</div>
@@ -188,6 +187,7 @@ if ($num_dbs > 1) {
if ($cfg['LeftFrameLight']) {
echo ' <form method="post" action="index.php3" name="left" target="_parent">' . "\n";
echo ' <input type="hidden" name="lang" value="' . $lang . '" />' . "\n";
echo ' <input type="hidden" name="convcharset" value="' . $convcharset . '" />' . "\n";
echo ' <input type="hidden" name="server" value="' . $server . '" />' . "\n";
echo ' <select name="lightm_db" onchange="this.form.submit()">' . "\n";
echo ' <option value=""> - </option>' . "\n";
@@ -205,9 +205,10 @@ if ($num_dbs > 1) {
if (!empty($db_start) && $db == $db_start) {
$selected_db = $j;
}
$tables = @mysql_list_tables($db);
$tables = @PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0;
$common_url_query = 'lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
if ($num_tables) {
@@ -221,8 +222,8 @@ if ($num_dbs > 1) {
&& $num_tables
&& (!$cfg['LeftFrameLight'] || $selected_db == $j)) {
$tooltip = array();
$result = mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
while ($tmp = mysql_fetch_array($result)) {
$result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
while ($tmp = PMA_mysql_fetch_array($result)) {
$tooltip[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '')
. '(' . (isset($tmp['Rows']) ? $tmp['Rows'] : '0') . ' ' . $strRows . ')';
} // end while
@@ -260,7 +261,7 @@ if ($num_dbs > 1) {
<?php
// Displays the list of tables from the current database
for ($t = 0; $t < $num_tables; $t++) {
$table = mysql_tablename($tables, $t);
$table = PMA_mysql_tablename($tables, $t);
$url_title = (!empty($tooltip) && isset($tooltip[$table]))
? str_replace('"', '&quot;', $tooltip[$table])
: '';
@@ -290,7 +291,7 @@ if ($num_dbs > 1) {
if (!empty($db_start) && $db == $db_start) {
// Gets the list of tables from the current database
for ($t = 0; $t < $num_tables; $t++) {
$table = mysql_tablename($tables, $t);
$table = PMA_mysql_tablename($tables, $t);
$url_title = (!empty($tooltip) && isset($tooltip[$table]))
? str_replace('"', '&quot;', $tooltip[$table])
: '';
@@ -372,7 +373,7 @@ if ($num_dbs > 1) {
// Case where only one database has to be displayed
else if ($num_dbs == 1) {
$db = $dblist[0];
$tables = @mysql_list_tables($db);
$tables = @PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0;
$common_url_query = 'lang=' . $lang
. '&amp;server=' . $server
@@ -387,8 +388,8 @@ else if ($num_dbs == 1) {
if ($cfg['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303
&& $num_tables) {
$tooltip = array();
$result = mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
while ($tmp = mysql_fetch_array($result)) {
$result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
while ($tmp = PMA_mysql_fetch_array($result)) {
$tooltip[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '')
. '(' . (isset($tmp['Rows']) ? $tmp['Rows'] : '0') . ' ' . $strRows . ')';
} // end while
@@ -405,7 +406,7 @@ else if ($num_dbs == 1) {
<?php
// Displays the list of tables from the current database
for ($j = 0; $j < $num_tables; $j++) {
$table = mysql_tablename($tables, $j);
$table = PMA_mysql_tablename($tables, $j);
$url_title = (!empty($tooltip) && isset($tooltip[$table]))
? str_replace('"', '&quot;', $tooltip[$table])
: '';

View File

@@ -74,8 +74,8 @@ if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
global $right_font_family, $font_size, $font_bigger;
global $is_header_sent;
if (mysql_error()) {
$conn_error = mysql_error();
if (PMA_mysql_error()) {
$conn_error = PMA_mysql_error();
} else if (isset($php_errormsg)) {
$conn_error = $php_errormsg;
} else {

View File

@@ -45,6 +45,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
* @global array the list of available translations
* @global string the current language
* @global integer the current server id
* @global string the currect charset for MySQL
* @global array the array of cookie variables if register_globals is
* off
*
@@ -56,7 +57,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
{
global $right_font_family, $font_size, $font_bigger;
global $cfg, $available_languages;
global $lang, $server;
global $lang, $server, $convcharset;
global $HTTP_COOKIE_VARS;
// Tries to get the username from cookie whatever are the values of the
@@ -226,6 +227,7 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
echo "\n";
?>
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="submit" value="<?php echo $GLOBALS['strLogin']; ?>" />
</td>
</tr>

View File

@@ -56,15 +56,15 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
. ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\''
. ' AND user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'';
if (isset($GLOBALS['dbh'])) {
$result = mysql_query($query, $GLOBALS['dbh']);
$result = PMA_mysql_query($query, $GLOBALS['dbh']);
} else {
$result = mysql_query($query);
$result = PMA_mysql_query($query);
}
// There is some bookmarks -> store them
if ($result > 0 && mysql_num_rows($result) > 0) {
$flag = 1;
while ($row = mysql_fetch_row($result)) {
while ($row = PMA_mysql_fetch_row($result)) {
$bookmark_list[$flag . ' - ' . $row[0]] = $row[1];
$flag++;
} // end while
@@ -95,11 +95,11 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
. ' AND user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\''
. ' AND id = ' . $id;
if (isset($GLOBALS['dbh'])) {
$result = mysql_query($query, $GLOBALS['dbh']);
$result = PMA_mysql_query($query, $GLOBALS['dbh']);
} else {
$result = mysql_query($query);
$result = PMA_mysql_query($query);
}
$bookmark_query = mysql_result($result, 0, 'query');
$bookmark_query = PMA_mysql_result($result, 0, 'query');
return $bookmark_query;
} // end of the 'PMA_queryBookmarks()' function
@@ -118,9 +118,9 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
$query = 'INSERT INTO ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table'])
. ' (id, dbase, user, query, label) VALUES (\'\', \'' . PMA_sqlAddslashes($fields['dbase']) . '\', \'' . PMA_sqlAddslashes($fields['user']) . '\', \'' . PMA_sqlAddslashes(urldecode($fields['query'])) . '\', \'' . PMA_sqlAddslashes($fields['label']) . '\')';
if (isset($GLOBALS['dbh'])) {
$result = mysql_query($query, $GLOBALS['dbh']);
$result = PMA_mysql_query($query, $GLOBALS['dbh']);
} else {
$result = mysql_query($query);
$result = PMA_mysql_query($query);
}
} // end of the 'PMA_addBookmarks()' function
@@ -140,9 +140,9 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
. ' WHERE user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\''
. ' AND id = ' . $id;
if (isset($GLOBALS['dbh'])) {
$result = mysql_query($query, $GLOBALS['dbh']);
$result = PMA_mysql_query($query, $GLOBALS['dbh']);
} else {
$result = mysql_query($query);
$result = PMA_mysql_query($query);
}
} // end of the 'PMA_deleteBookmarks()' function

View File

@@ -60,13 +60,13 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
if (PMA_MYSQL_INT_VERSION >= 32321) {
// Whether to quote table and fields names or not
if ($use_backquotes) {
mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
PMA_mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
} else {
mysql_query('SET SQL_QUOTE_SHOW_CREATE = 0');
PMA_mysql_query('SET SQL_QUOTE_SHOW_CREATE = 0');
}
$result = mysql_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table));
$result = PMA_mysql_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table));
if ($result != FALSE && mysql_num_rows($result) > 0) {
$tmpres = mysql_fetch_array($result);
$tmpres = PMA_mysql_fetch_array($result);
// Fix for case problems with winwin, thanks to
// Pawe<77> Szczepa<70>ski <pauluz at users.sourceforge.net>
$pos = strpos($tmpres[1], ' (');
@@ -83,8 +83,8 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$schema_create .= 'CREATE TABLE ' . PMA_htmlFormat(PMA_backquote($table), $use_backquotes) . ' (' . $crlf;
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
while ($row = mysql_fetch_array($result)) {
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
while ($row = PMA_mysql_fetch_array($result)) {
$schema_create .= ' ' . PMA_htmlFormat(PMA_backquote($row['Field'], $use_backquotes)) . ' ' . $row['Type'];
if (isset($row['Default']) && $row['Default'] != '') {
$schema_create .= ' DEFAULT \'' . PMA_htmlFormat(PMA_sqlAddslashes($row['Default'])) . '\'';
@@ -101,8 +101,8 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$schema_create = ereg_replace(',' . $crlf . '$', '', $schema_create);
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
while ($row = mysql_fetch_array($result))
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
while ($row = PMA_mysql_fetch_array($result))
{
$kname = $row['Key_name'];
$comment = (isset($row['Comment'])) ? $row['Comment'] : '';
@@ -181,15 +181,15 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
global $current_row;
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
if ($result != FALSE) {
$fields_cnt = mysql_num_fields($result);
$rows_cnt = mysql_num_rows($result);
// Checks whether the field is an integer or not
for ($j = 0; $j < $fields_cnt; $j++) {
$field_set[$j] = PMA_backquote(mysql_field_name($result, $j), $use_backquotes);
$type = mysql_field_type($result, $j);
$field_set[$j] = PMA_backquote(PMA_mysql_field_name($result, $j), $use_backquotes);
$type = PMA_mysql_field_type($result, $j);
if ($type == 'tinyint' || $type == 'smallint' || $type == 'mediumint' || $type == 'int' ||
$type == 'bigint' ||$type == 'timestamp') {
$field_num[$j] = TRUE;
@@ -221,7 +221,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$time0 = time();
}
while ($row = mysql_fetch_row($result)) {
while ($row = PMA_mysql_fetch_row($result)) {
$current_row++;
for ($j = 0; $j < $fields_cnt; $j++) {
if (!isset($row[$j])) {
@@ -308,7 +308,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
global $current_row;
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$current_row = 0;
$fields_cnt = mysql_num_fields($result);
$rows_cnt = mysql_num_rows($result);
@@ -322,11 +322,11 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$time0 = time();
}
while ($row = mysql_fetch_row($result)) {
while ($row = PMA_mysql_fetch_row($result)) {
$current_row++;
$table_list = '(';
for ($j = 0; $j < $fields_cnt; $j++) {
$table_list .= PMA_backquote(mysql_field_name($result, $j), $use_backquotes) . ', ';
$table_list .= PMA_backquote(PMA_mysql_field_name($result, $j), $use_backquotes) . ', ';
}
$table_list = substr($table_list, 0, -2);
$table_list .= ')';
@@ -348,7 +348,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
if (!isset($row[$j])) {
$schema_insert .= ' NULL, ';
} else if ($row[$j] == '0' || $row[$j] != '') {
$type = mysql_field_type($result, $j);
$type = PMA_mysql_field_type($result, $j);
// a number
if ($type == 'tinyint' || $type == 'smallint' || $type == 'mediumint' || $type == 'int' ||
$type == 'bigint' ||$type == 'timestamp') {
@@ -505,14 +505,14 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
// Gets the data from the database
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$fields_cnt = mysql_num_fields($result);
@set_time_limit($GLOBALS['cfg']['ExecTimeLimit']);
// Format the data
$i = 0;
while ($row = mysql_fetch_row($result)) {
while ($row = PMA_mysql_fetch_row($result)) {
$schema_insert = '';
for ($j = 0; $j < $fields_cnt; $j++) {
if (!isset($row[$j])) {
@@ -570,8 +570,8 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
*/
function PMA_getTableXML($db, $table, $limit_from = 0, $limit_to = 0, $crlf, $error_url) {
$local_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
for ($i = 0; $row = mysql_fetch_array($result, MYSQL_ASSOC); $i++) {
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
for ($i = 0; $row = PMA_mysql_fetch_array($result, MYSQL_ASSOC); $i++) {
$columns[$i] = $row['Field'];
}
$columns_cnt = count($columns);
@@ -588,9 +588,9 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
}
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$buffer = ' <!-- ' . $GLOBALS['strTable'] . ' ' . $table . ' -->' . $crlf;
while ($record = mysql_fetch_array($result, MYSQL_ASSOC)) {
while ($record = PMA_mysql_fetch_array($result, MYSQL_ASSOC)) {
$buffer .= ' <' . $table . '>' . $crlf;
for ($i = 0; $i < $columns_cnt; $i++) {
// There is no way to dectect a "NULL" value with PHP3

View File

@@ -0,0 +1,132 @@
<?php
/* $Id$ */
/**
* Charset conversion functions.
*/
if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
define('PMA_CHARSET_CONVERSION_LIB_INCLUDED', 1);
/**
* Loads the recode or iconv extensions if any of it is not loaded yet
*/
if ($cfg['AllowAnywhereRecoding'] && $allow_recoding &&
((PMA_PHP_INT_VERSION >= 40000 && !@ini_get('safe_mode') && @ini_get('enable_dl'))
|| (PMA_PHP_INT_VERSION > 30009 && !@get_cfg_var('safe_mode')))
&& @function_exists('dl')) {
if (!(@extension_loaded('recode')||@extension_loaded('iconv'))) {
if (PMA_IS_WINDOWS) {
$suffix = '.dll';
} else {
$suffix = '.so';
}
@dl('recode'.$suffix);
if (!@extension_loaded('recode')) {
@dl('iconv'.$suffix);
if (!@extension_loaded('iconv')) {
echo $strCantLoadRecodeIconv;
exit();
}
}
}
} // end load mysql extension
// if allowed recoding, we should try to load extensions for it...
/**
* Converts encoding according to current settings.
*
* @param mixed what to convert (string or array of strings or object returned by mysql_fetch_field)
*
* @return string converted string or array of strings
*
* @access public
*
* @author nijel
*/
function PMA_convert_display_charset($what) {
global $cfg, $allow_recoding, $charset, $convcharset;
if (!($cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
return $what;
} else {
if (is_array($what)) {
$result = array();
reset($what);
while(list($key,$val) = each($what)) {
//Debug: echo '['.$key.']='.$val.'<br>';
if (is_string($val) || is_array($val)) {
if (is_string($key)) {
$result[PMA_convert_display_charset($key)] = PMA_convert_display_charset($val);
} else {
$result[$key] = PMA_convert_display_charset($val);
}
} else {
$result[$key] = $val;
}
}
return $result;
} elseif (is_string($what)) {
if (@function_exists('iconv')) {
//Debug: echo 'PMA_convert_display_charset: '.$what.'->'.iconv($convcharset, $charset, $what)."\n<br>";
return iconv($convcharset, $charset, $what);
} else if (@function_exists('libiconv')) {
return iconv($convcharset, $charset, $what);
} else if (@function_exists('recode_string')) {
return recode_string($convcharset . '..' . $charset, $what);
} else {
echo $strCantUseRecodeIconv;
return $what;
}
} elseif (is_object($what)) {
// isn't it object returned from mysql_fetch_field ?
if (@is_string($what->name)) {
$what->name = PMA_convert_display_charset( $what->name );
}
if (@is_string($what->table)) {
$what->table = PMA_convert_display_charset( $what->table );
}
if (@is_string($what->Database)) {
$what->Database = PMA_convert_display_charset( $what->Database );
}
return $what;
} else {
// when we don't know what it is we don't touch it...
return $what;
}
}
}
/**
* Converts encoding of text according to current settings.
*
* @param string what to convert
*
* @return string converted text
*
* @access public
*
* @author nijel
*/
function PMA_convert_charset($what) {
global $cfg, $allow_recoding, $charset, $convcharset;
if (!($cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
return $what;
} else {
if (@function_exists('iconv')) {
//Debug: echo 'PMA_convert_charset: '.$what.'->'.iconv($charset, $convcharset, $what)."\n<br>";
return iconv($charset, $convcharset, $what);
} else if (@function_exists('libiconv')) {
return iconv($charset, $convcharset, $what);
} else if (@function_exists('recode_string')) {
return recode_string($charset . '..' . $convcharset, $what);
} else {
echo $strCantUseRecodeIconv;
return $what;
}
}
}
} // PMA_CHARSET_CONVERSION_LIB_INCLUDED
?>

View File

@@ -116,6 +116,16 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
include('./config.inc.developer.php3');
}
/**
* Include MySQL wrappers.
*/
include('./libraries/mysql_wrappers.lib.php3');
/**
* Include charset conversion.
*/
include('./libraries/charset_conversion.lib.php3');
/**
* Gets constants that defines the PHP, MySQL... releases.
* This include must be located physically before any code that needs to
@@ -331,7 +341,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
}
if (!$error_message) {
$error_message = mysql_error();
$error_message = PMA_mysql_error();
}
if (!$the_query && !empty($GLOBALS['sql_query'])) {
$the_query = $GLOBALS['sql_query'];
@@ -348,7 +358,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
echo ' ' . $GLOBALS['strSQLQuery'] . '&nbsp;:&nbsp;' . "\n";
if ($is_modify_link) {
echo ' ['
. '<a href="db_details.php3?lang=' . $GLOBALS['lang'] . '&amp;server=' . urlencode($GLOBALS['server']) . '&amp;db=' . urlencode($GLOBALS['db']) . '&amp;sql_query=' . urlencode($the_query) . '&amp;show_query=y">' . $GLOBALS['strEdit'] . '</a>'
. '<a href="db_details.php3?convcharset=' . $GLOBALS['convcharset'] . '&amp;lang=' . $GLOBALS['lang'] . '&amp;server=' . urlencode($GLOBALS['server']) . '&amp;db=' . urlencode($GLOBALS['db']) . '&amp;sql_query=' . urlencode($the_query) . '&amp;show_query=y">' . $GLOBALS['strEdit'] . '</a>'
. ']' . "\n";
} // end if
if($cfg['UseSyntaxColoring']){
@@ -632,8 +642,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$cfg['Server']['controlpass']
);
if ($dbh == FALSE) {
if (mysql_error()) {
$conn_error = mysql_error();
if (PMA_mysql_error()) {
$conn_error = PMA_mysql_error();
} else if (isset($php_errormsg)) {
$conn_error = $php_errormsg;
} else {
@@ -689,18 +699,18 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
for ($i = 0; $i < $dblist_cnt; $i++) {
if ($is_show_dbs && ereg('(^|[^\])(_|%)', $dblist[$i])) {
$local_query = 'SHOW DATABASES LIKE \'' . $dblist[$i] . '\'';
$rs = mysql_query($local_query, $dbh);
$rs = PMA_mysql_query($local_query, $dbh);
// "SHOW DATABASES" statement is disabled
if ($i == 0
&& (mysql_error() && mysql_errno() == 1045)) {
&& (PMA_mysql_error() && mysql_errno() == 1045)) {
$true_dblist[] = str_replace('\\_', '_', str_replace('\\%', '%', $dblist[$i]));
$is_show_dbs = FALSE;
}
// Debug
// else if (mysql_error()) {
// else if (PMA_mysql_error()) {
// PMA_mysqlDie('', $local_query, FALSE);
// }
while ($row = @mysql_fetch_row($rs)) {
while ($row = @PMA_mysql_fetch_row($rs)) {
$true_dblist[] = $row[0];
} // end while
if ($rs) {
@@ -720,13 +730,13 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// (if MYSQL supports this)
if (PMA_MYSQL_INT_VERSION >= 32330) {
$local_query = 'SHOW VARIABLES LIKE \'safe_show_database\'';
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
$is_safe_show_dbs = ($rs) ? @mysql_result($rs, 0, 'Value') : FALSE;
$rs = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
$is_safe_show_dbs = ($rs) ? @PMA_mysql_result($rs, 0, 'Value') : FALSE;
// ... and if on, try to get the available dbs list
if ($is_safe_show_dbs && strtoupper($is_safe_show_dbs) != 'OFF') {
$uva_alldbs = mysql_list_dbs($userlink);
while ($uva_row = mysql_fetch_array($uva_alldbs)) {
while ($uva_row = PMA_mysql_fetch_array($uva_alldbs)) {
$dblist[] = $uva_row[0];
} // end while
$dblist_cnt = count($dblist);
@@ -740,7 +750,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$auth_query = 'SELECT User, Select_priv '
. 'FROM mysql.user '
. 'WHERE User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\'';
$rs = mysql_query($auth_query, $dbh); // Debug: or PMA_mysqlDie('', $auth_query, FALSE);
$rs = PMA_mysql_query($auth_query, $dbh); // Debug: or PMA_mysqlDie('', $auth_query, FALSE);
} // end
} // end if (!$dblist_cnt)
@@ -748,7 +758,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// usable db list
if (!$dblist_cnt
&& ($rs && @mysql_numrows($rs))) {
$row = mysql_fetch_array($rs);
$row = PMA_mysql_fetch_array($rs);
mysql_free_result($rs);
// Correction uva 19991215
// Previous code assumed database "mysql" admin table "db" column
@@ -765,7 +775,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// 1. get allowed dbs from the "mysql.db" table
// lem9: User can be blank (anonymous user)
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\' OR User = \'\')';
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
$rs = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
if ($rs && @mysql_numrows($rs)) {
// Will use as associative array of the following 2 code
// lines:
@@ -777,7 +787,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// populating $dblist[], as previous code did. But it is
// now populated with actual database names instead of
// with regular expressions.
while ($row = mysql_fetch_array($rs)) {
while ($row = PMA_mysql_fetch_array($rs)) {
// loic1: all databases cases - part 1
if (empty($row['Db']) || $row['Db'] == '%') {
$uva_mydbs['%'] = 1;
@@ -792,12 +802,12 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$uva_alldbs = mysql_list_dbs($dbh);
// loic1: all databases cases - part 2
if (isset($uva_mydbs['%'])) {
while ($uva_row = mysql_fetch_array($uva_alldbs)) {
while ($uva_row = PMA_mysql_fetch_array($uva_alldbs)) {
$dblist[] = $uva_row[0];
} // end while
} // end if
else {
while ($uva_row = mysql_fetch_array($uva_alldbs)) {
while ($uva_row = PMA_mysql_fetch_array($uva_alldbs)) {
$uva_db = $uva_row[0];
if (isset($uva_mydbs[$uva_db]) && $uva_mydbs[$uva_db] == 1) {
$dblist[] = $uva_db;
@@ -826,9 +836,9 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// 2. get allowed dbs from the "mysql.tables_priv" table
$local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\'';
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
$rs = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
if ($rs && @mysql_numrows($rs)) {
while ($row = mysql_fetch_array($rs)) {
while ($row = PMA_mysql_fetch_array($rs)) {
if (PMA_isInto($row['Db'], $dblist) == -1) {
$dblist[] = $row['Db'];
}
@@ -870,7 +880,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
if ($num_dbs) {
$true_dblist = array();
for ($i = 0; $i < $num_dbs; $i++) {
$dblink = @mysql_select_db($dblist[$i]);
$dblink = @PMA_mysql_select_db($dblist[$i]);
if ($dblink) {
$true_dblist[] = $dblist[$i];
} // end if
@@ -888,8 +898,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$num_dbs = ($dbs) ? @mysql_num_rows($dbs) : 0;
$real_num_dbs = 0;
for ($i = 0; $i < $num_dbs; $i++) {
$db_name_tmp = mysql_dbname($dbs, $i);
$dblink = @mysql_select_db($db_name_tmp);
$db_name_tmp = PMA_mysql_dbname($dbs, $i);
$dblink = @PMA_mysql_select_db($db_name_tmp);
if ($dblink) {
$dblist[] = $db_name_tmp;
$real_num_dbs++;
@@ -912,10 +922,11 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* Since MySQL 3.23.6 this allows to use non-alphanumeric characters in
* these names.
*
* @param string the database, table or field name to "backquote"
* @param mixed the database, table or field name to "backquote" or
* array of it
* @param boolean a flag to bypass this function (used by dump functions)
*
* @return string the "backquoted" database, table or field name if the
* @return mixed the "backquoted" database, table or field name if the
* current MySQL release is >= 3.23.6, the original one
* else
*
@@ -926,7 +937,17 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
if ($do_it
&& PMA_MYSQL_INT_VERSION >= 32306
&& !empty($a_name) && $a_name != '*') {
return '`' . $a_name . '`';
if (is_array($a_name)) {
$result = array();
reset($a_name);
while(list($key,$val) = each($a_name)) {
$result[$key] = '`' . $val . '`';
}
return $result;
} else {
return '`' . $a_name . '`';
}
} else {
return $a_name;
}
@@ -1005,8 +1026,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
*/
function PMA_countRecords($db, $table, $ret = FALSE)
{
$result = mysql_query('SELECT COUNT(*) AS num FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table));
$num = ($result) ? mysql_result($result, 0, 'num') : 0;
$result = PMA_mysql_query('SELECT COUNT(*) AS num FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table));
$num = ($result) ? PMA_mysql_result($result, 0, 'num') : 0;
mysql_free_result($result);
if ($ret) {
return $num;
@@ -1031,7 +1052,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
if (isset($GLOBALS['reload']) && $GLOBALS['reload']) {
echo "\n";
$reload_url = './left.php3'
. '?lang=' . $GLOBALS['lang']
. '?convcharset=' . $GLOBALS['convcharset']
. '&lang=' . $GLOBALS['lang']
. '&server=' . $GLOBALS['server']
. ((!empty($GLOBALS['db'])) ? '&db=' . urlencode($GLOBALS['db']) : '');
?>
@@ -1045,9 +1067,9 @@ window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
// Corrects the tooltip text via JS if required
else if (isset($GLOBALS['table']) && $GLOBALS['cfg']['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303) {
$result = @mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($GLOBALS['db']) . ' LIKE \'' . PMA_sqlAddslashes($GLOBALS['table'], TRUE) . '\'');
$result = @PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($GLOBALS['db']) . ' LIKE \'' . PMA_sqlAddslashes($GLOBALS['table'], TRUE) . '\'');
if ($result) {
$tmp = mysql_fetch_array($result, MYSQL_ASSOC);
$tmp = PMA_mysql_fetch_array($result, MYSQL_ASSOC);
$tooltip = (empty($tmp['Comment']))
? ''
: $tmp['Comment'] . ' ';
@@ -1083,6 +1105,7 @@ if (typeof(document.getElementById) != 'undefined'
if ($GLOBALS['cfg']['ShowSQL'] == TRUE && !empty($GLOBALS['sql_query'])) {
// Basic url query part
$url_qpart = '?lang=' . $GLOBALS['lang']
. '&amp;convcharset=' . $GLOBALS['convcharset']
. '&amp;server=' . $GLOBALS['server']
. ((!empty($GLOBALS['db'])) ? '&amp;db=' . urlencode($GLOBALS['db']) : '')
. ((!empty($GLOBALS['table'])) ? '&amp;table=' . urlencode($GLOBALS['table']) : '');

View File

@@ -50,14 +50,14 @@ if (!defined('PMA_IS_WINDOWS')) {
// MySQL Version
if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) {
if (!empty($server)) {
$result = mysql_query('SELECT VERSION() AS version');
$result = PMA_mysql_query('SELECT VERSION() AS version');
if ($result != FALSE && @mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$row = PMA_mysql_fetch_array($result);
$match = explode('.', $row['version']);
} else {
$result = @mysql_query('SHOW VARIABLES LIKE \'version\'');
$result = @PMA_mysql_query('SHOW VARIABLES LIKE \'version\'');
if ($result != FALSE && @mysql_num_rows($result) > 0){
$row = mysql_fetch_row($result);
$row = PMA_mysql_fetch_row($result);
$match = explode('.', $row[1]);
}
}

View File

@@ -159,8 +159,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
else if (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
&& (!empty($db) && !empty($table))) {
$local_query = 'SELECT COUNT(*) AS total FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$the_total = mysql_result($result, 0, 'total');
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$the_total = PMA_mysql_result($result, 0, 'total');
mysql_free_result($result);
}
@@ -189,6 +189,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @param string the url-encoded query
*
* @global string the current language
* @global string the currect charset for MySQL
* @global integer the server to use (refers to the number in the
* configuration file)
* @global string the database name
@@ -210,7 +211,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
*/
function PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_query)
{
global $lang, $server, $db, $table;
global $lang, $convcharset, $server, $db, $table;
global $goto;
global $num_rows, $unlim_num_rows, $pos, $session_max_rows;
global $disp_direction, $repeat_cells;
@@ -239,6 +240,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<td>
<form action="sql.php3" method="post">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -255,6 +257,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<td>
<form action="sql.php3" method="post">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -279,6 +282,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<form action="sql.php3" method="post"
onsubmit="return (checkFormElementInRange(this, 'session_max_rows', 1) && checkFormElementInRange(this, 'pos', 0, <?php echo $unlim_num_rows - 1; ?>))">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -327,6 +331,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<td>
<form action="sql.php3" method="post">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -344,6 +349,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<form action="sql.php3" method="post"
onsubmit="return <?php echo (($pos + $session_max_rows < $unlim_num_rows && $num_rows >= $session_max_rows) ? 'true' : 'false'); ?>">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -370,6 +376,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<td>
<form action="sql.php3" method="post">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -404,6 +411,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @return boolean always true
*
* @global string the current language
* @global string the current charset for MySQL
* @global integer the server to use (refers to the number in the
* configuration file)
* @global string the database name
@@ -425,7 +433,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
*/
function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0)
{
global $lang, $server, $db, $table;
global $lang, $convcharset, $server, $db, $table;
global $goto;
global $sql_query, $num_rows, $pos, $session_max_rows;
global $vertical_display, $disp_direction, $repeat_cells;
@@ -455,6 +463,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
}
$text_url = 'sql.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -601,6 +610,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$sorted_sql_query = $unsorted_sql_query . $sort_order;
}
$url_query = 'lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -704,6 +714,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @return boolean always true
*
* @global string the current language
* @global string the current charset for MySQL
* @global integer the server to use (refers to the number in the
* configuration file)
* @global string the database name
@@ -726,7 +737,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
*/
function PMA_displayTableBody(&$dt_result, &$is_display, $map)
{
global $lang, $server, $db, $table;
global $lang, $convcharset, $server, $db, $table;
global $goto;
global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells;
@@ -757,10 +768,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// table being displayed has one or more keys; but to display
// delete/edit options correctly for tables without keys.
// loic1: use 'mysql_fetch_array' rather than 'mysql_fetch_row' to get
// loic1: use 'PMA_mysql_fetch_array' rather than 'PMA_mysql_fetch_row' to get
// the NULL values
while ($row = mysql_fetch_array($dt_result)) {
while ($row = PMA_mysql_fetch_array($dt_result)) {
// lem9: "vertical display" mode stuff
if (($row_no != 0) && ($repeat_cells != 0) && !($row_no % $repeat_cells) && $disp_direction == 'horizontal') {
@@ -824,7 +835,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// php4 function is available or not
$pointer = (function_exists('is_null') ? $i : $meta->name);
if (!isset($row[$meta->name])
if (!isset($row[$pointer])
|| (function_exists('is_null') && is_null($row[$pointer]))) {
$condition .= 'IS NULL AND';
} else {
@@ -853,6 +864,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// 1.2 Defines the urls for the modify/delete link(s)
$url_query = 'lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -898,6 +910,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
. '&goto=main.php3';
$del_url = 'sql.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=mysql'
. '&amp;sql_query=' . urlencode('KILL ' . $row['Id'])
@@ -941,7 +954,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$pointer = (function_exists('is_null') ? $i : $meta->name);
if ($meta->numeric == 1) {
if (!isset($row[$meta->name])
if (!isset($row[$pointer])
|| (function_exists('is_null') && is_null($row[$pointer]))) {
$vertical_display['data'][$row_no][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$pointer] != '') {
@@ -953,9 +966,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
. ' FROM ' . PMA_backquote($map[$meta->name][0])
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. ' = ' . $row[$pointer];
$dispresult = mysql_query($dispsql);
$dispresult = PMA_mysql_query($dispsql);
if ($dispresult && mysql_num_rows($dispresult) > 0) {
$dispval = mysql_result($dispresult, 0);
$dispval = PMA_mysql_result($dispresult, 0);
}
else {
$dispval = $GLOBALS['strLinkNotFound'];
@@ -968,6 +981,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$vertical_display['data'][$row_no][$i] .= '<a href="sql.php3?'
. 'lang=' . $lang . '&amp;server=' . $server
. '&amp;convcharset=' . $convcharset
. '&amp;db=' . urlencode($db) . '&amp;table=' . urlencode($map[$meta->name][0])
. '&amp;pos=0&amp;session_max_rows=' . $session_max_rows . '&amp;dontlimitchars=' . $dontlimitchars
. '&amp;sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = ' . $row[$pointer]) . '"' . $title . '>'
@@ -980,15 +994,15 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$vertical_display['data'][$row_no][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n";
}
} else if ($GLOBALS['cfg']['ShowBlob'] == FALSE && eregi('BLOB', $meta->type)) {
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT
// loic1 : PMA_mysql_fetch_fields returns BLOB in place of TEXT
// fields type, however TEXT fields must be displayed even
// if $cfg['ShowBlob'] is false -> get the true type of the
// fields.
$field_flags = mysql_field_flags($dt_result, $i);
$field_flags = PMA_mysql_field_flags($dt_result, $i);
if (eregi('BINARY', $field_flags)) {
$vertical_display['data'][$row_no][$i] = ' <td align="center" valign="top" bgcolor="' . $bgcolor . '">[BLOB]</td>' . "\n";
} else {
if (!isset($row[$meta->name])
if (!isset($row[$pointer])
|| (function_exists('is_null') && is_null($row[$pointer]))) {
$vertical_display['data'][$row_no][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$pointer] != '') {
@@ -1006,7 +1020,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
}
}
} else {
if (!isset($row[$meta->name])
if (!isset($row[$pointer])
|| (function_exists('is_null') && is_null($row[$pointer]))) {
$vertical_display['data'][$row_no][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$pointer] != '') {
@@ -1020,7 +1034,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
}
}
// loic1: displays special characters from binaries
$field_flags = mysql_field_flags($dt_result, $i);
$field_flags = PMA_mysql_field_flags($dt_result, $i);
if (eregi('BINARY', $field_flags)) {
$row[$pointer] = str_replace("\x00", '\0', $row[$pointer]);
$row[$pointer] = str_replace("\x08", '\b', $row[$pointer]);
@@ -1045,9 +1059,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
. ' FROM ' . PMA_backquote($map[$meta->name][0])
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. ' = \'' . PMA_sqlAddslashes($row[$pointer]) . '\'';
$dispresult = @mysql_query($dispsql);
$dispresult = @PMA_mysql_query($dispsql);
if ($dispresult && mysql_num_rows($dispresult) > 0) {
$dispval = mysql_result($dispresult, 0);
$dispval = PMA_mysql_result($dispresult, 0);
}
else {
$dispval = $GLOBALS['strLinkNotFound'];
@@ -1060,6 +1074,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$vertical_display['data'][$row_no][$i] .= '<a href="sql.php3?'
. 'lang=' . $lang . '&amp;server=' . $server
. '&amp;convcharset=' . $convcharset
. '&amp;db=' . urlencode($db) . '&amp;table=' . urlencode($map[$meta->name][0])
. '&amp;pos=0&amp;session_max_rows=' . $session_max_rows . '&amp;dontlimitchars=' . $dontlimitchars
. '&amp;sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = \'' . PMA_sqlAddslashes($relation_id) . '\'') . '"' . $title . '>'
@@ -1386,17 +1401,17 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$local_query = 'SELECT master_field, foreign_table, foreign_field'
. ' FROM ' . PMA_backquote($cfg['Server']['relation'])
. ' WHERE master_table IN ' . $tabs;
$result = @mysql_query($local_query);
$result = @PMA_mysql_query($local_query);
if ($result) {
while ($rel = mysql_fetch_row($result)) {
while ($rel = PMA_mysql_fetch_row($result)) {
// check for display field?
if (!empty($cfg['Server']['table_info'])) {
$ti_query = 'SELECT display_field'
. ' FROM ' . PMA_backquote($cfg['Server']['table_info'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($rel[1]) . '\'';
$result_ti = @mysql_query($ti_query);
$result_ti = @PMA_mysql_query($ti_query);
if ($result_ti) {
list($display_field) = mysql_fetch_row($result_ti);
list($display_field) = PMA_mysql_fetch_row($result_ti);
} else {
$display_field = '';
}

View File

@@ -0,0 +1,117 @@
<?php
/* $Id$ */
/**
* Functions to wrap around MySQL database functions. This is basically made
* to allow charset conversion, but later may be useful for other stuff.
*/
if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
define('PMA_MYSQL_WRAPPERS_LIB_INCLUDED', 1);
function PMA_mysql_dbname($result, $row, $field = FALSE) {
if ($field != FALSE) {
return PMA_convert_display_charset(mysql_dbname($result, $row, $field));
} else {
return PMA_convert_display_charset(mysql_dbname($result, $row));
}
}
function PMA_mysql_error($id = FALSE) {
if ($id != FALSE) {
return PMA_convert_display_charset(mysql_error($param));
} else {
return PMA_convert_display_charset(mysql_error());
}
}
function PMA_mysql_fetch_array($result, $type = FALSE) {
if ($type != FALSE) {
return PMA_convert_display_charset(mysql_fetch_array($result, $type));
} else {
return PMA_convert_display_charset(mysql_fetch_array($result));
}
}
function PMA_mysql_fetch_field($result , $field_offset = FALSE) {
if ($field_offset != FALSE) {
return PMA_convert_display_charset(mysql_fetch_field($result, $field_offset));
} else {
return PMA_convert_display_charset(mysql_fetch_field($result));
}
}
function PMA_mysql_fetch_object($result) {
return PMA_convert_display_charset(mysql_fetch_object($result));
}
function PMA_mysql_fetch_row($result) {
return PMA_convert_display_charset(mysql_fetch_row($result));
}
function PMA_mysql_field_flags($result, $field_offset) {
return PMA_convert_display_charset(mysql_field_flags($result, $field_offset));
}
function PMA_mysql_field_name($result, $field_index) {
return PMA_convert_display_charset(mysql_field_name($result, $field_index));
}
function PMA_mysql_field_type($result, $field_index) {
return PMA_convert_display_charset(mysql_field_type($result, $field_index));
}
function PMA_mysql_list_fields($database_name, $table_name, $link_identifier = FALSE) {
if ($link_identifier != FALSE) {
return mysql_list_fields($database_name, PMA_convert_charset($table_name), $link_identifier);
} else {
return mysql_list_fields($database_name, PMA_convert_charset($table_name));
}
}
function PMA_mysql_list_tables($database_name, $link_identifier = FALSE) {
if ($link_identifier != FALSE) {
return mysql_list_tables(PMA_convert_charset($database_name), $link_identifier);
} else {
return mysql_list_tables(PMA_convert_charset($database_name));
}
}
function PMA_mysql_query($query, $link_identifier = FALSE, $result_mode = FALSE) {
if ($link_identifier != FALSE) {
if ($result_mode != FALSE) {
return mysql_query(PMA_convert_charset($query), $link_identifier, $result_mode);
} else {
return mysql_query(PMA_convert_charset($query), $link_identifier);
}
} else {
return mysql_query(PMA_convert_charset($query));
}
}
function PMA_mysql_result($result, $row, $field = FALSE) {
if ($field != FALSE) {
return PMA_convert_display_charset(mysql_result($result, $row, PMA_convert_charset($field)));
} else {
return PMA_convert_display_charset(mysql_result($result, $row));
}
}
function PMA_mysql_select_db($database_name, $link_identifier = FALSE) {
if ($link_identifier != FALSE) {
return mysql_select_db(PMA_convert_charset($database_name), $link_identifier);
} else {
return mysql_select_db(PMA_convert_charset($database_name));
}
}
function PMA_mysql_tablename($result, $i) {
return PMA_convert_display_charset(mysql_tablename($result, $i));
}
} // PMA_MYSQL_WRAPPERS_LIB_INCLUDED
?>

View File

@@ -45,11 +45,13 @@ $available_languages = array(
'bg-koi8r' => array('bg|bulgarian', 'bulgarian-koi8', 'bg'),
'ca' => array('ca|catalan', 'catala', 'ca'),
'cs-iso' => array('cs|czech', 'czech-iso', 'cs'),
'cs-utf8' => array('cs|czech', 'czech-utf8', 'cs'),
'cs-win1250' => array('cs|czech', 'czech-win1250', 'cs'),
'da' => array('da|danish', 'danish', 'da'),
'de' => array('de([-_][[:alpha:]]{2})?|german', 'german', 'de'),
'el' => array('el|greek', 'greek', 'el'),
'en' => array('en([-_][[:alpha:]]{2})?|english', 'english', 'en'),
'en-utf8' => array('en([-_][[:alpha:]]{2})?|english', 'english-utf8', 'en'),
'es' => array('es([-_][[:alpha:]]{2})?|spanish', 'spanish', 'es'),
'et' => array('et|estonian', 'estonian', 'et'),
'fi' => array('fi|finnish', 'finnish', 'fi'),
@@ -209,6 +211,9 @@ if (empty($lang)) {
$lang = $cfg['DefaultLang'];
}
$allow_recoding = FALSE; // Default fallback value
if (!isset($convcharset) || empty($convcharset)) $convcharset = $cfg['DefaultCharset'];
// 4. Defines the associated filename and load the translation
$lang_file = $lang_path . $available_languages[$lang][1] . '.inc.php3';
require('./' . $lang_file);

View File

@@ -143,6 +143,7 @@ function change(the_field) {
else {
if (lpos <= 0) {
l += '?lang=' + the_form['lang'].value
+= '&convcharset=' . the_form['convcharset'].value
+ '&server=' + the_form['server'].value
+ '&grants=1'
+ '&host=' + escape(the_form['host'].value)

View File

@@ -34,7 +34,7 @@ else if (isset($reload) && $reload) {
?>
<script type="text/javascript" language="javascript1.2">
<!--
window.parent.frames['nav'].location.replace('./left.php3?lang=<?php echo $lang; ?>&server=<?php echo $server; ?>');
window.parent.frames['nav'].location.replace('./left.php3?lang=<?php echo $lang; ?>&convcharset=<?php echo $convcharset; ?>&server=<?php echo $server; ?>');
//-->
</script>
<?php
@@ -61,11 +61,11 @@ if ($server > 0) {
// $server_info .= ':' . $cfg['Server']['socket'];
// }
$local_query = 'SELECT VERSION() as version, USER() as user';
$res = mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, '');
$mysql_cur_user_and_host = mysql_result($res, 0, 'user');
$res = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, '');
$mysql_cur_user_and_host = PMA_mysql_result($res, 0, 'user');
$mysql_cur_user = substr($mysql_cur_user_and_host, 0, strpos($mysql_cur_user_and_host, '@'));
$full_string = str_replace('%pma_s1%', mysql_result($res, 0, 'version'), $strMySQLServerProcess);
$full_string = str_replace('%pma_s1%', PMA_mysql_result($res, 0, 'version'), $strMySQLServerProcess);
$full_string = str_replace('%pma_s2%', $server_info, $full_string);
$full_string = str_replace('%pma_s3%', $mysql_cur_user_and_host, $full_string);
@@ -77,7 +77,7 @@ if ($server > 0) {
* Reload mysql (flush privileges)
*/
if (($server > 0) && isset($mode) && ($mode == 'reload')) {
$result = mysql_query('FLUSH PRIVILEGES'); // Debug: or PMA_mysqlDie('', 'FLUSH PRIVILEGES', FALSE, 'main.php3?lang=' . $lang . '&amp;server=' . $server);
$result = PMA_mysql_query('FLUSH PRIVILEGES'); // Debug: or PMA_mysqlDie('', 'FLUSH PRIVILEGES', FALSE, 'main.php3?lang=' . $lang . '&amp;server=' . $server);
echo '<p><b>';
if ($result != 0) {
echo $strMySQLReloaded;
@@ -140,6 +140,7 @@ if ($server == 0 || count($cfg['Servers']) > 1) {
?>
</select>
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="submit" value="<?php echo $strGo; ?>" />
</form>
</td>
@@ -165,12 +166,12 @@ if ($server > 0) {
$is_create_priv = FALSE;
$is_process_priv = FALSE;
$is_reload_priv = FALSE;
$is_superuser = @mysql_query('USE mysql', $userlink);
$is_superuser = @PMA_mysql_query('USE mysql', $userlink);
if ($dbh) {
$local_query = 'SELECT Create_priv, Process_priv, Reload_priv FROM mysql.user WHERE User = \'' . PMA_sqlAddslashes($mysql_cur_user) . '\'';
$rs_usr = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
$rs_usr = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
if ($rs_usr) {
while ($result_usr = mysql_fetch_array($rs_usr)) {
while ($result_usr = PMA_mysql_fetch_array($rs_usr)) {
if (!$is_create_priv) {
$is_create_priv = ($result_usr['Create_priv'] == 'Y');
}
@@ -190,13 +191,13 @@ if ($server > 0) {
// the one he just dropped :)
if (!$is_create_priv) {
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Create_priv = \'Y\' AND User = \'' . PMA_sqlAddslashes($mysql_cur_user) . '\'';
$rs_usr = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
$rs_usr = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
if ($rs_usr) {
$re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards
$re1 = '(^|[^\])(\\\)+'; // escaped wildcards
while ($row = mysql_fetch_array($rs_usr)) {
while ($row = PMA_mysql_fetch_array($rs_usr)) {
if (ereg($re0 . '(%|_)', $row['Db'])
|| (!mysql_select_db(ereg_replace($re1 . '(%|_)', '\\1\\3', $row['Db']), $userlink) && @mysql_errno() != 1044)) {
|| (!PMA_mysql_select_db(ereg_replace($re1 . '(%|_)', '\\1\\3', $row['Db']), $userlink) && @mysql_errno() != 1044)) {
$db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $row['Db']));
$db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
$is_create_priv = TRUE;
@@ -210,16 +211,16 @@ if ($server > 0) {
// GRANTS...
// Maybe we'll find a little CREATE priv there :)
$local_query = 'SHOW GRANTS FOR ' . $mysql_cur_user_and_host;
$rs_usr = mysql_query($local_query, $dbh);
$rs_usr = PMA_mysql_query($local_query, $dbh);
if (!$rs_usr) {
// OK, now we'd have to guess the user's hostname, but we
// only try out the 'username'@'%' case.
$local_query = 'SHOW GRANTS FOR ' . $mysql_cur_user;
$rs_usr = mysql_query($local_query, $dbh);
$rs_usr = PMA_mysql_query($local_query, $dbh);
}
if ($rs_usr) {
$re = '(^|(\\\\\\\\)+|[^\])';
while ($row = mysql_fetch_row($rs_usr)) {
while ($row = PMA_mysql_fetch_row($rs_usr)) {
$show_grants_dbname = substr($row[0], strpos($row[0], ' ON ') + 4,(strpos($row[0], '.', strpos($row[0], ' ON ')) - strpos($row[0], ' ON ') - 4));
$show_grants_str = substr($row[0],6,(strpos($row[0],' ON ')-6));
if (($show_grants_str == 'ALL') || ($show_grants_str == 'ALL PRIVILEGES') || ($show_grants_str == 'CREATE') || strpos($show_grants_str, 'CREATE')) {
@@ -228,7 +229,7 @@ if ($server > 0) {
$db_to_create = '';
break;
} // end if
else if (ereg($re . '%|_', $show_grants_dbname) || !mysql_select_db($show_grants_dbname, $userlink) && @mysql_errno() != 1044) {
else if (ereg($re . '%|_', $show_grants_dbname) || !PMA_mysql_select_db($show_grants_dbname, $userlink) && @mysql_errno() != 1044) {
$show_grants_dbname = ereg_replace($re . '%', '\\1...', ereg_replace($re . '_', '\\1?', $show_grants_dbname));
$db_to_create = $show_grants_dbname;
$is_create_priv = TRUE;
@@ -246,7 +247,7 @@ if ($server > 0) {
$db_to_create = '';
} // end else
$common_url_query = 'lang=' . $lang . '&amp;server=' . $server;
$common_url_query = 'lang=' . $lang . '&amp;server=' . $server . '&amp;convcharset=' . $convcharset;
if ($is_superuser) {
$cfg['ShowMysqlInfo'] = TRUE;
@@ -282,6 +283,7 @@ if ($server > 0) {
<?php echo $strCreateNewDatabase . '&nbsp;' . PMA_showDocuShort('C/R/CREATE_DATABASE.html'); ?><br />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="reload" value="1" />
<input type="text" name="db" value="<?php echo $db_to_create; ?>" maxlength="64" class="textfield" />
<input type="submit" value="<?php echo $strCreate; ?>" />
@@ -441,6 +443,7 @@ if (empty($cfg['Lang'])) {
<td nowrap="nowrap">
<form method="post" action="index.php3" target="_parent">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
Language <a href="./translators.html" target="documentation">(*)</a>:
<select name="lang" dir="ltr" onchange="this.form.submit();">
<?php
@@ -482,6 +485,40 @@ if (empty($cfg['Lang'])) {
<?php
}
echo "\n";
?>
<?php
if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
?>
<!-- Charset Selection -->
<tr>
<td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
<td nowrap="nowrap">
<form method="post" action="index.php3" target="_parent">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<?php echo $strMySQLCharset;?>:
<select name="convcharset" dir="ltr" onchange="this.form.submit();">
<?php
echo "\n";
reset($cfg['AvailableCharsets']);
while (list($id, $tmpcharset) = each($cfg['AvailableCharsets'])) {
if ($convcharset == $tmpcharset) {
$selected = ' selected="selected"';
} else {
$selected = '';
}
echo ' ';
echo '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
}
?>
</select>
<noscript><input type="submit" value="Go" /></noscript>
</form>
</td>
</tr>
<?php
echo "\n";
}
?>
<!-- Documentation -->

View File

@@ -102,6 +102,7 @@ if (!empty($submit_mult) && !empty($what)) {
?>
<form action="<?php echo $action; ?>" method="post">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<?php
echo "\n";
@@ -176,17 +177,17 @@ else if ((get_magic_quotes_gpc() && stripslashes($mult_btn) == $strYes)
$sql_query .= $a_query . ';' . "\n";
if ($query_type != 'drop_db') {
mysql_select_db($db);
PMA_mysql_select_db($db);
}
$result = @mysql_query($a_query) or PMA_mysqlDie('', $a_query, FALSE, $err_url);
$result = @PMA_mysql_query($a_query) or PMA_mysqlDie('', $a_query, FALSE, $err_url);
} // end if
} // end for
if ($query_type == 'drop_tbl'
|| $query_type == 'drop_fld'
|| $query_type == 'optimize_tbl') {
mysql_select_db($db);
$result = @mysql_query($sql_query) or PMA_mysqlDie('', '', FALSE, $err_url);
PMA_mysql_select_db($db);
$result = @PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', FALSE, $err_url);
}
PMA_showMessage($strSuccess);

View File

@@ -28,9 +28,9 @@ require('./tbl_properties_table_info.php3');
if (!empty($cfg['Server']['pdf_pages'])){
// First we get all tables in the current db
$tab_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
$tab_rs = mysql_query($tab_query) or PMA_mysqlDie('', $tab_query, '', $err_url_0);
$tab_rs = PMA_mysql_query($tab_query) or PMA_mysqlDie('', $tab_query, '', $err_url_0);
$selectboxall[] = '--';
while ($curr_table = @mysql_fetch_array($tab_rs)) {
while ($curr_table = @PMA_mysql_fetch_array($tab_rs)) {
// i'd like to check if all required tables are present
// and otherwise give some hint
if($curr_table[0] == $cfg['Server']['relation']){$relex =1;}else{
@@ -69,7 +69,7 @@ if (!empty($cfg['Server']['pdf_pages'])){
}
$ins_query = 'INSERT INTO ' . PMA_backquote($cfg['Server']['pdf_pages']) .
' (page_descr) VALUES (\'' . $newpage . '\')';
mysql_query($ins_query) or PMA_mysqlDie('', $ins_query, '', $err_url_0);
PMA_mysql_query($ins_query) or PMA_mysqlDie('', $ins_query, '', $err_url_0);
break;
case 'edcoord':
while (list($key,$arrvalue) = each($ctable)) {
@@ -79,7 +79,7 @@ if (!empty($cfg['Server']['pdf_pages'])){
$test_query = 'SELECT * FROM '.PMA_backquote($cfg['Server']['table_coords']) .
' WHERE table_name = \''.$arrvalue['name'] . '\'' .
' AND pdf_page_number = '.$chpage;
$test_rs = mysql_query($test_query) or PMA_mysqlDie('', $test_query, '', $err_url_0);
$test_rs = PMA_mysql_query($test_query) or PMA_mysqlDie('', $test_query, '', $err_url_0);
if(mysql_num_rows($test_rs)>0){
if($arrvalue['delete'] == 'y'){
$ch_query = 'DELETE FROM '.PMA_backquote($cfg['Server']['table_coords']) .
@@ -96,7 +96,7 @@ if (!empty($cfg['Server']['pdf_pages'])){
' VALUES (\''.$arrvalue['name'].'\','.$chpage.','.
$arrvalue['x'].','.$arrvalue['y'].')';
}
mysql_query($ch_query) or PMA_mysqlDie('', $ch_query, '', $err_url_0);
PMA_mysql_query($ch_query) or PMA_mysqlDie('', $ch_query, '', $err_url_0);
}
}
break;
@@ -104,19 +104,20 @@ if (!empty($cfg['Server']['pdf_pages'])){
}
// now first show some possibility to choose a page for the pdf
$page_query = 'SELECT * FROM ' .PMA_backquote($cfg['Server']['pdf_pages']);
$page_rs = mysql_query($page_query) or PMA_mysqlDie('', $page_query, '', $err_url_0);
$page_rs = PMA_mysql_query($page_query) or PMA_mysqlDie('', $page_query, '', $err_url_0);
if(mysql_num_rows($page_rs)>0){
?>
<form action="pdf_pages.php3" method="post" name="selpage">
<?php echo $strChoosePage; ?>
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="do" value="choosepage" />
<select name="chpage" onChange="this.form.submit()">
<?php
while ($curr_page = @mysql_fetch_array($page_rs)) {
while ($curr_page = @PMA_mysql_fetch_array($page_rs)) {
echo '<option value="'.$curr_page['page_nr'].'"';
if($chpage==$curr_page['page_nr']){echo ' selected="selected"';}
echo '>';
@@ -134,6 +135,7 @@ if (!empty($cfg['Server']['pdf_pages'])){
<?php echo $strCreatePage; ?>
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="do" value="createpage" />
@@ -148,6 +150,7 @@ if (!empty($cfg['Server']['pdf_pages'])){
<form action="pdf_pages.php3" method="post" name="edcoord">
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="chpage" value="<?php echo $chpage; ?>" />
@@ -158,9 +161,9 @@ if (!empty($cfg['Server']['pdf_pages'])){
if(isset($ctable)){unset($ctable);}
$page_query = 'SELECT * FROM' . PMA_backquote($cfg['Server']['table_coords']) .
' WHERE pdf_page_number='.$chpage;
$page_rs = mysql_query($page_query) or PMA_mysqlDie('', $page_query, '', $err_url_0);
$page_rs = PMA_mysql_query($page_query) or PMA_mysqlDie('', $page_query, '', $err_url_0);
$i=0;
while ($sh_page = @mysql_fetch_array($page_rs)) {
while ($sh_page = @PMA_mysql_fetch_array($page_rs)) {
echo '<tr ';
if($i % 2==0){
echo 'bgcolor="'.$cfg['BgcolorOne'].'"';

View File

@@ -254,6 +254,7 @@ class PMA_PDF extends FPDF
echo '<a href="db_details_structure.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '">' . $GLOBALS['strBack'] . '</a>';
@@ -281,7 +282,6 @@ class PMA_PDF extends FPDF
} // end of the "PMA_PDF" class
/**
* Draws tables schema
*
@@ -406,12 +406,12 @@ class PMA_RT_Table
$this->table_name = $table_name;
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
$result = mysql_query($sql);
$result = PMA_mysql_query($sql);
if (!$result || !mysql_num_rows($result)) {
$pdf->PMA_PDF_die(sprintf($GLOBALS['strPdfInvalidTblName'], $table_name));
}
// load fields
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
$this->fields[] = $row[0];
}
@@ -424,30 +424,30 @@ class PMA_RT_Table
. PMA_backquote($GLOBALS['cfg']['Server']['table_coords'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table_name) . '\''
. ' AND pdf_page_number = ' . $pdf_page_number;
$result = mysql_query($sql);
$result = PMA_mysql_query($sql);
if (!$result || !mysql_num_rows($result)) {
$pdf->PMA_PDF_die(sprintf($GLOBALS['strConfigureTableCoord'], $table_name));
}
list($this->x, $this->y) = mysql_fetch_array($result);
list($this->x, $this->y) = PMA_mysql_fetch_array($result);
$this->x = (double) $this->x;
$this->y = (double) $this->y;
//displayfield
$sql = 'SELECT display_field from '.PMA_backquote($GLOBALS['cfg']['Server']['table_info'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table_name) . '\'';
$result = mysql_query($sql);
$result = PMA_mysql_query($sql);
if(mysql_num_rows($result)>0){
list($this->displayfield) = mysql_fetch_array($result);
list($this->displayfield) = PMA_mysql_fetch_array($result);
}
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
$this->displayfield = $row['display_field '];
}
// index
$sql = 'SHOW index from '.PMA_backquote($table_name);
$result = mysql_query($sql);
$result = PMA_mysql_query($sql);
if(mysql_num_rows($result)>0){
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
if($row['Key_name'] == 'PRIMARY'){
$this->primary = $row['Column_name'];
}
@@ -806,8 +806,8 @@ class PMA_RT
// get tables on this page
$tab_sql = 'SELECT table_name from '.PMA_backquote($GLOBALS['cfg']['Server']['table_coords']) .
' WHERE pdf_page_number = ' . $which_rel;
$tab_rs = mysql_query($tab_sql) or PMA_mysqlDie('', $tab_sql, '', $err_url_0);
while ($curr_table = @mysql_fetch_array($tab_rs)) {
$tab_rs = PMA_mysql_query($tab_sql) or PMA_mysqlDie('', $tab_sql, '', $err_url_0);
while ($curr_table = @PMA_mysql_fetch_array($tab_rs)) {
$alltables[] = $curr_table['table_name'];
$intable = "'" . implode("','",$alltables) . "'";
}
@@ -815,11 +815,11 @@ class PMA_RT
. PMA_backquote($GLOBALS['cfg']['Server']['relation'])
. ' WHERE master_table in (' . $intable . ') '
. ' AND foreign_table in (' . $intable . ')';
$result = mysql_query($sql);
$result = PMA_mysql_query($sql);
if (!$result || !mysql_num_rows($result)) {
$pdf->PMA_PDF_die($GLOBALS['strPdfInvalidPageNum']);
}
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
$this->PMA_RT_addRelation($row['master_table'] , $row['master_field'], $row['foreign_table'], $row['foreign_field']);
}

View File

@@ -12,7 +12,7 @@ require('./libraries/common.lib.php3');
/**
* Displays PHP information
*/
$is_superuser = @mysql_query('USE mysql', $userlink);
$is_superuser = @PMA_mysql_query('USE mysql', $userlink);
if ($is_superuser || $cfg['ShowPhpInfo']) {
phpinfo();
}

View File

@@ -187,6 +187,7 @@ if (!isset($goto)
}
$err_url = $goto
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. (($goto == 'tbl_properties.php3') ? '&amp;table=' . urlencode($table) : '');
@@ -304,8 +305,8 @@ if (!$cfg['AllowUserDropDatabase']
// Checks if the user is a Superuser
// TODO: set a global variable with this information
// loic1: optimized query
$result = @mysql_query('USE mysql');
if (mysql_error()) {
$result = @PMA_mysql_query('USE mysql');
if (PMA_mysql_error()) {
include('./header.inc.php3');
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
}
@@ -349,11 +350,11 @@ if ($sql_query != '') {
}
// Runs multiple queries
else if (mysql_select_db($db)) {
else if (PMA_mysql_select_db($db)) {
$mult = TRUE;
for ($i = 0; $i < $pieces_count; $i++) {
$a_sql_query = $pieces[$i];
$result = mysql_query($a_sql_query);
$result = PMA_mysql_query($a_sql_query);
if ($result == FALSE) { // readdump failed
$my_die = $a_sql_query;
break;
@@ -393,7 +394,7 @@ if ($goto == 'tbl_properties.php3') {
if (!isset($table)) {
$goto = 'db_details.php3';
} else {
$is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
$is_table = @PMA_mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
if (!($is_table && @mysql_numrows($is_table))) {
$goto = 'db_details.php3';
unset($table);
@@ -407,7 +408,7 @@ if ($goto == 'db_details.php3') {
if (!isset($db)) {
$goto = 'main.php3';
} else {
$is_db = @mysql_select_db($db);
$is_db = @PMA_mysql_select_db($db);
if (!$is_db) {
$goto = 'main.php3';
unset($db);

12
scripts/sync_czech.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
#
# Shell script that synchronises all czech translations using iso-8859-2 as basic
echo -n "Creating windows-1250 ... "
iconv -f iso8859-2 -t windows-1250 czech-iso.inc.php3| sed 's/iso-8859-2/windows-1250/' > czech-win1250.inc.php3
echo done
echo -n "Creating utf-8 ... "
iconv -f iso8859-2 -t utf-8 czech-iso.inc.php3| sed -e 's/iso-8859-2/utf-8/' -e '/\$charset/a\
$allow_recoding = TRUE;' > czech-utf8.inc.php3
echo done

9
scripts/sync_english.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
#
# Shell script that synchronises all english translations using iso-8859-1 as basic
echo -n "Creating utf-8 ... "
iconv -f iso8859-2 -t utf-8 english.inc.php3| sed -e 's/iso-8859-1/utf-8/' -e '/\$charset/a\
$allow_recoding = TRUE;' > english-utf8.inc.php3
echo done

View File

@@ -29,6 +29,7 @@ if (empty($goto)) {
if (!isset($err_url)) {
$err_url = (!empty($back) ? $back : $goto)
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. (isset($db) ? '&amp;db=' . urlencode($db) : '')
. ((strpos(' ' . $goto, 'db_details') != 1 && isset($table)) ? '&amp;table=' . urlencode($table) : '');
@@ -48,8 +49,8 @@ if (!defined('PMA_CHK_DROP')
// Checks if the user is a Superuser
// TODO: set a global variable with this information
// loic1: optimized query
$result = @mysql_query('USE mysql');
if (mysql_error()) {
$result = @PMA_mysql_query('USE mysql');
if (PMA_mysql_error()) {
include('./header.inc.php3');
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
} // end if
@@ -106,6 +107,7 @@ if ($is_select) {
if ($goto == 'sql.php3') {
$goto = 'sql.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -160,6 +162,7 @@ if ($do_confirm) {
?>
<form action="sql.php3" method="post">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo isset($table) ? $table : ''; ?>" />
@@ -246,7 +249,7 @@ else {
} // end if...else
mysql_select_db($db);
PMA_mysql_select_db($db);
// If the query is a DELETE query with no WHERE clause, get the number of
// rows that will be deleted (mysql_affected_rows will always return 0 in
@@ -254,9 +257,9 @@ else {
if ($is_delete
&& eregi('^DELETE([[:space:]].+)?([[:space:]]FROM[[:space:]](.+))$', $sql_query, $parts)
&& !eregi('[[:space:]]WHERE[[:space:]]', $parts[3])) {
$cnt_all_result = @mysql_query('SELECT COUNT(*) as count' . $parts[2]);
$cnt_all_result = @PMA_mysql_query('SELECT COUNT(*) as count' . $parts[2]);
if ($cnt_all_result) {
$num_rows = mysql_result($cnt_all_result, 0, 'count');
$num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
mysql_free_result($cnt_all_result);
} else {
$num_rows = 0;
@@ -264,11 +267,11 @@ else {
}
// Executes the query
$result = @mysql_query($full_sql_query);
$result = @PMA_mysql_query($full_sql_query);
// Displays an error message if required and stop parsing the script
if (mysql_error()) {
$error = mysql_error();
if (PMA_mysql_error()) {
$error = PMA_mysql_error();
include('./header.inc.php3');
$full_err_url = (ereg('^(db_details|tbl_properties)', $err_url))
? $err_url . '&amp;show_query=y&amp;sql_query=' . urlencode($sql_query)
@@ -307,9 +310,9 @@ else {
if (!empty($array[1])) {
// ... and makes a count(*) to count the entries
$count_query = 'SELECT COUNT(*) AS count FROM ' . $array[1];
$cnt_all_result = mysql_query($count_query);
$cnt_all_result = PMA_mysql_query($count_query);
if ($cnt_all_result) {
$unlim_num_rows = mysql_result($cnt_all_result, 0, 'count');
$unlim_num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
mysql_free_result($cnt_all_result);
}
} else {
@@ -345,7 +348,7 @@ else {
if (!isset($table)) {
$goto = 'db_details.php3';
} else {
$is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
$is_table = @PMA_mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
if (!($is_table && @mysql_numrows($is_table))) {
$goto = 'db_details.php3';
unset($table);
@@ -359,7 +362,7 @@ else {
if (!isset($db)) {
$goto = 'main.php3';
} else {
$is_db = @mysql_select_db($db);
$is_db = @PMA_mysql_select_db($db);
if (!$is_db) {
$goto = 'main.php3';
unset($db);
@@ -397,7 +400,7 @@ else {
}
// Gets the list of fields properties
while ($field = mysql_fetch_field($result)) {
while ($field = PMA_mysql_fetch_field($result)) {
$fields_meta[] = $field;
}
$fields_cnt = count($fields_meta);
@@ -420,6 +423,7 @@ else {
if ($disp_mode[6] == '1') {
$lnk_goto = 'sql.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -429,6 +433,7 @@ else {
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;sql_query=' . urlencode($sql_query);
$url_query = '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -450,6 +455,7 @@ else {
// Displays "printable view" link if required
if ($disp_mode[9] == '1') {
$url_query = '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -475,6 +481,7 @@ else {
$goto = 'sql.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)

View File

@@ -17,6 +17,7 @@ require('./header.inc.php3');
*/
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
@@ -118,9 +119,9 @@ if (isset($submit)) {
// To allow replication, we first select the db to use and then run queries
// on this db.
$sql_query = 'USE ' . PMA_backquote($db);
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD ' . $query;
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$sql_query_cpy = $sql_query . ';';
// Builds the primary keys statements and updates the table
@@ -134,7 +135,7 @@ if (isset($submit)) {
$primary = ereg_replace(', $', '', $primary);
if (!empty($primary)) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD PRIMARY KEY (' . $primary . ')';
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$sql_query_cpy .= "\n" . $sql_query . ';';
}
} // end if
@@ -150,7 +151,7 @@ if (isset($submit)) {
$index = ereg_replace(', $', '', $index);
if (!empty($index)) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX (' . $index . ')';
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$sql_query_cpy .= "\n" . $sql_query . ';';
}
} // end if
@@ -166,7 +167,7 @@ if (isset($submit)) {
$unique = ereg_replace(', $', '', $unique);
if (!empty($unique)) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE (' . $unique . ')';
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$sql_query_cpy .= "\n" . $sql_query . ';';
}
} // end if
@@ -183,7 +184,7 @@ if (isset($submit)) {
$fulltext = ereg_replace(', $', '', $fulltext);
if (!empty($fulltext)) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT (' . $fulltext . ')';
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$sql_query_cpy .= "\n" . $sql_query . ';';
}
} // end if

View File

@@ -19,6 +19,7 @@ if (!isset($submit_mult)) {
*/
$err_url = 'tbl_properties_structure.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
@@ -86,10 +87,10 @@ if (isset($submit)) {
// To allow replication, we first select the db to use and then run queries
// on this db.
$sql_query = 'USE ' . PMA_backquote($db);
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
// Optimization fix - 2 May 2001 - Robbat2
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' CHANGE ' . $query;
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
$btnDrop = 'Fake';
include('./tbl_properties_structure.php3');
@@ -120,8 +121,8 @@ else {
$field = PMA_sqlAddslashes($selected[$i], TRUE);
}
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . " LIKE '$field'";
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$fields_meta[] = mysql_fetch_array($result);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$fields_meta[] = PMA_mysql_fetch_array($result);
mysql_free_result($result);
}

View File

@@ -13,6 +13,7 @@ if (!empty($message)) {
$goto_cpy = $goto;
$goto = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -59,6 +60,7 @@ if ($goto != 'db_details.php3' && $goto != 'tbl_properties.php3') {
} else {
$err_url = $goto
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. (($goto == 'tbl_properties.php3') ? '&amp;table=' . urlencode($table) : '');
@@ -69,11 +71,11 @@ if ($goto != 'db_details.php3' && $goto != 'tbl_properties.php3') {
* Get the list of the fields of the current table
*/
mysql_select_db($db);
$table_def = mysql_query('SHOW FIELDS FROM ' . PMA_backquote($table));
$table_def = PMA_mysql_query('SHOW FIELDS FROM ' . PMA_backquote($table));
if (isset($primary_key)) {
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key;
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$row = mysql_fetch_array($result);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$row = PMA_mysql_fetch_array($result);
// No row returned
if (!$row) {
unset($row);
@@ -81,6 +83,7 @@ if (isset($primary_key)) {
$goto_cpy = $goto;
$goto = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
@@ -103,7 +106,7 @@ if (isset($primary_key)) {
else
{
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1';
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
unset($row);
}
@@ -123,6 +126,7 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5)
<!-- Change table properties form -->
<form method="post" action="tbl_replace.php3" name="insertForm">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -161,7 +165,7 @@ $timestamp_seen = 0;
$fields_cnt = mysql_num_rows($table_def);
for ($i = 0; $i < $fields_cnt; $i++) {
$row_table_def = mysql_fetch_array($table_def);
$row_table_def = PMA_mysql_fetch_array($table_def);
$field = $row_table_def['Field'];
if ($row_table_def['Type'] == 'datetime' && empty($row[$field])) {
$row[$field] = date('Y-m-d H:i:s', time());

View File

@@ -17,6 +17,7 @@ require('./header.inc.php3');
*/
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
@@ -204,7 +205,7 @@ if (isset($submit)) {
}
// Executes the query
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$sql_query = $query_cpy . ';';
unset($query_cpy);
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated;

View File

@@ -89,6 +89,7 @@ require('./libraries/zip.lib.php3');
*/
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. (isset($table) ? '&amp;table=' . urlencode($table) : '');
@@ -179,7 +180,7 @@ else {
*/
// Gets the number of tables if a dump of a database has been required
if (!isset($table)) {
$tables = mysql_list_tables($db);
$tables = PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0;
} else {
$num_tables = 1;
@@ -219,7 +220,7 @@ else {
}
while ($i < $num_tables) {
if (!isset($single)) {
$table = mysql_tablename($tables, $i);
$table = PMA_mysql_tablename($tables, $i);
}
if (isset($tmp_select) && !strpos(' ' . $tmp_select, '|' . $table . '|')) {
$i++;
@@ -303,7 +304,7 @@ else {
$i = 0;
while ($i < $num_tables) {
if (!isset($single)) {
$table = mysql_tablename($tables, $i);
$table = PMA_mysql_tablename($tables, $i);
}
if (!isset($limit_from) || !isset($limit_to)) {
$limit_from = $limit_to = 0;

View File

@@ -31,19 +31,19 @@ if (PMA_MYSQL_INT_VERSION >= 32323) {
if (!defined('PMA_IDX_INCLUDED')) {
// Not a valid db name -> back to the welcome page
if (!empty($db)) {
$is_db = @mysql_select_db($db);
$is_db = @PMA_mysql_select_db($db);
}
if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
}
// Not a valid table name -> back to the db_details.php3
if (!empty($table)) {
$is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
$is_table = @PMA_mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
}
if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server .'&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
} else if (isset($is_table)) {
mysql_free_result($is_table);
@@ -61,6 +61,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
if (defined('PMA_IDX_INCLUDED')) {
$err_url_0 = 'db_details.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
}
@@ -75,12 +76,12 @@ if (defined('PMA_IDX_INCLUDED')) {
$idx_cnt = count($ret_keys);
} else {
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$idx_cnt = mysql_num_rows($result);
}
for ($i = 0; $i < $idx_cnt; $i++) {
$row = (defined('PMA_IDX_INCLUDED') ? $ret_keys[$i] : mysql_fetch_array($result));
$row = (defined('PMA_IDX_INCLUDED') ? $ret_keys[$i] : PMA_mysql_fetch_array($result));
if ($row['Key_name'] != $prev_index ){
$indexes[] = $row['Key_name'];
@@ -115,13 +116,13 @@ if (defined('PMA_IDX_INCLUDED')) {
mysql_data_seek($fields_rs, 0);
} else {
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
$fields_rs = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$fields_cnt = mysql_num_rows($fields_rs);
}
$fields_names = array();
$fields_types = array();
while ($row = mysql_fetch_array($fields_rs)) {
while ($row = PMA_mysql_fetch_array($fields_rs)) {
$fields_names[] = $row['Field'];
// loic1: set or enum types: slashes single quotes inside options
if (eregi('^(set|enum)\((.+)\)$', $row['Type'], $tmp)) {
@@ -159,6 +160,7 @@ if (!defined('PMA_IDX_INCLUDED')
$err_url = 'tbl_indexes.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
@@ -218,7 +220,7 @@ if (!defined('PMA_IDX_INCLUDED')
$sql_query .= $index_fields . ')';
}
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', FALSE, $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', FALSE, $err_url);
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
include('./tbl_properties.php3');
@@ -293,6 +295,7 @@ else if (!defined('PMA_IDX_INCLUDED')
<form action="tbl_indexes.php3" method="post" name="index_frm"
onsubmit="if (typeof(this.elements['index'].disabled) != 'undefined') {this.elements['index'].disabled = false}">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
@@ -410,6 +413,7 @@ else if (!defined('PMA_IDX_INCLUDED')
<!-- Indexes form -->
<form action="tbl_indexes.php3" method="post">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />

View File

@@ -18,7 +18,7 @@ function PMA_myHandler($sql_insert = '')
global $sql_insert_data;
$sql_insert = eregi_replace('INSERT INTO (`?)' . $table . '(`?)', 'INSERT INTO ' . $target, $sql_insert);
$result = mysql_query($sql_insert) or PMA_mysqlDie('', $sql_insert, '', $GLOBALS['err_url']);
$result = PMA_mysql_query($sql_insert) or PMA_mysqlDie('', $sql_insert, '', $GLOBALS['err_url']);
$sql_insert_data .= $sql_insert . ';' . "\n";
} // end of the 'PMA_myHandler()' function
@@ -36,6 +36,7 @@ require('./libraries/common.lib.php3');
*/
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
@@ -80,8 +81,8 @@ if (isset($new_name) && trim($new_name) != '') {
$sql_structure = PMA_getTableDef($db, $table, "\n", $err_url);
$sql_structure = eregi_replace('^CREATE TABLE (`?)' . $table . '(`?)', 'CREATE TABLE ' . $target, $sql_structure);
$result = @mysql_query($sql_structure);
if (mysql_error()) {
$result = @PMA_mysql_query($sql_structure);
if (PMA_mysql_error()) {
include('./header.inc.php3');
PMA_mysqlDie('', $sql_structure, '', $err_url);
} else if (isset($sql_query)) {
@@ -95,8 +96,8 @@ if (isset($new_name) && trim($new_name) != '') {
// speedup copy table - staybyte - 22. Juni 2001
if (PMA_MYSQL_INT_VERSION >= 32300) {
$sql_insert_data = 'INSERT INTO ' . $target . ' SELECT * FROM ' . $source;
$result = @mysql_query($sql_insert_data);
if (mysql_error()) {
$result = @PMA_mysql_query($sql_insert_data);
if (PMA_mysql_error()) {
include('./header.inc.php3');
PMA_mysqlDie('', $sql_insert_data, '', $err_url);
}
@@ -111,8 +112,8 @@ if (isset($new_name) && trim($new_name) != '') {
// Drops old table if the user has requested to move it
if (isset($submit_move)) {
$sql_drop_table = 'DROP TABLE ' . $source;
$result = @mysql_query($sql_drop_table);
if (mysql_error()) {
$result = @PMA_mysql_query($sql_drop_table);
if (PMA_mysql_error()) {
include('./header.inc.php3');
PMA_mysqlDie('', $sql_drop_table, '', $err_url);
}

View File

@@ -17,12 +17,14 @@ if (!isset($selected_tbl)) {
if (isset($table)) {
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
} else {
$err_url = 'db_details.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
}
@@ -67,15 +69,15 @@ while (list($key, $table) = each($the_tables)) {
// The 'show table' statement works correct since 3.23.03
if (PMA_MYSQL_INT_VERSION >= 32303) {
$local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$showtable = mysql_fetch_array($result);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$showtable = PMA_mysql_fetch_array($result);
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
} else {
$local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$showtable = array();
$num_rows = mysql_result($result, 0, 'count');
$num_rows = PMA_mysql_result($result, 0, 'count');
$show_comment = '';
} // end display comments
if ($result) {
@@ -87,7 +89,7 @@ while (list($key, $table) = each($the_tables)) {
* Gets table keys and retains them
*/
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$primary = '';
$indexes = array();
$lastIndex = '';
@@ -95,7 +97,7 @@ while (list($key, $table) = each($the_tables)) {
$indexes_data = array();
$pk_array = array(); // will be use to emphasis prim. keys in the table
// view
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
// Backups the list of primary keys
if ($row['Key_name'] == 'PRIMARY') {
$primary .= $row['Column_name'] . ', ';
@@ -129,14 +131,14 @@ while (list($key, $table) = each($the_tables)) {
* Gets fields properties
*/
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$fields_cnt = mysql_num_rows($result);
// check if we can use Relations (Mike Beck)
$have_rel = FALSE;
if ($cfg['Server']['relation']) {
$tables = @mysql_query('SELECT COUNT(*) AS count FROM ' . PMA_backquote($cfg['Server']['relation']));
$have_rel = ($tables) ? mysql_result($tables, 0, 'count') : FALSE;
$tables = @PMA_mysql_query('SELECT COUNT(*) AS count FROM ' . PMA_backquote($cfg['Server']['relation']));
$have_rel = ($tables) ? PMA_mysql_result($tables, 0, 'count') : FALSE;
} // end if
if ($have_rel) {
// Find which tables are related with the current one and write it in
@@ -145,9 +147,9 @@ while (list($key, $table) = each($the_tables)) {
. ' FROM ' . PMA_backquote($cfg['Server']['relation'])
. ' WHERE master_table = \'' . urldecode($table) .'\'';
$relations = @mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
$relations = @PMA_mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
$res_rel = array();
while ($relrow = @mysql_fetch_array($relations)) {
while ($relrow = @PMA_mysql_fetch_array($relations)) {
$col = $relrow['master_field'];
$res_rel[$col] = $relrow['rel'];
}
@@ -190,7 +192,7 @@ while (list($key, $table) = each($the_tables)) {
<?php
$i = 0;
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
$bgcolor = ($i % 2) ?$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
$i++;

View File

@@ -6,6 +6,7 @@
<form method="post" action="<?php echo $action; ?>">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<?php
@@ -296,9 +297,9 @@ if ($action == 'tbl_create.php3' && PMA_MYSQL_INT_VERSION >= 32300) {
if ($action == 'tbl_create.php3') {
// find mysql capability - staybyte - 11. June 2001
$query = 'SHOW VARIABLES LIKE \'have_%\'';
$result = mysql_query($query);
$result = PMA_mysql_query($query);
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($tmp = mysql_fetch_array($result)) {
while ($tmp = PMA_mysql_fetch_array($result)) {
if (isset($tmp['Variable_name'])) {
switch ($tmp['Variable_name']) {
case 'have_bdb':

View File

@@ -52,6 +52,7 @@ require('./tbl_properties_table_info.php3');
onsubmit="return checkSqlQuery(this)">
<input type="hidden" name="is_js_confirmed" value="0" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />

View File

@@ -15,10 +15,12 @@ require('./libraries/bookmark.lib.php3');
*/
$err_url_0 = 'db_details.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db);
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
@@ -31,21 +33,21 @@ $err_url = 'tbl_properties.php3'
if (!isset($is_db) || !$is_db) {
// Not a valid db name -> back to the welcome page
if (!empty($db)) {
$is_db = @mysql_select_db($db);
$is_db = @PMA_mysql_select_db($db);
}
if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
}
} // end if (ensures db exists)
if (!isset($is_table) || !$is_table) {
// Not a valid table name -> back to the db_details.php3
if (!empty($table)) {
$is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
$is_table = @PMA_mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
}
if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
} else if (isset($is_table)) {
mysql_free_result($is_table);
@@ -64,6 +66,7 @@ if (!isset($message)) {
* Set parameters for links
*/
$url_query = 'lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)

View File

@@ -17,6 +17,7 @@ require('./tbl_properties_table_info.php3');
<form method="post" action="tbl_dump.php3" name="tbl_dump">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<table cellpadding="5" border="2" align="center">

View File

@@ -16,7 +16,7 @@ $url_query .= '&amp;back=tbl_properties_operations.php3';
if (isset($submitorderby) && !empty($order_field)) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($table)
. ' ORDER BY ' . PMA_backquote(urldecode($order_field));
$result = mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
PMA_showMessage((get_magic_quotes_gpc()) ? addslashes($strSuccess) : $strSuccess);
} // end if
@@ -31,8 +31,8 @@ require('./tbl_properties_table_info.php3');
* Get columns names
*/
$local_query = 'SHOW COLUMNS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
for ($i = 0; $row = mysql_fetch_array($result); $i++) {
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
for ($i = 0; $row = PMA_mysql_fetch_array($result); $i++) {
$columns[$i] = $row['Field'];
}
mysql_free_result($result);
@@ -52,6 +52,7 @@ if (PMA_MYSQL_INT_VERSION >= 32334) {
<form method="post" action="tbl_properties_operations.php3">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<?php echo $strAlterOrderBy; ?>&nbsp;:
@@ -81,6 +82,7 @@ echo "\n";
onsubmit="return emptyFormElements(this, 'new_name')">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="reload" value="1" />
@@ -101,6 +103,7 @@ echo "\n";
onsubmit="return emptyFormElements(this, 'new_name')">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="reload" value="1" />
@@ -143,6 +146,7 @@ for ($i = 0; $i < $num_dbs; $i++) {
onsubmit="return emptyFormElements(this, 'new_name')">
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="reload" value="1" />
@@ -285,12 +289,12 @@ if (!empty($cfg['Server']['relation'])) {
. ' FROM ' . $cfg['Server']['relation']
. ' WHERE master_table = \'' . $table . '\';';
// we need this mysql_select_db if the user has access to more than one db
// we need this PMA_mysql_select_db if the user has access to more than one db
// and $db is not the last of the list, because PMA_availableDatabases()
// has made a mysql_select_db() on the last one
mysql_select_db($db);
// has made a PMA_mysql_select_db() on the last one
PMA_mysql_select_db($db);
$result = @mysql_query($local_query);
$result = @PMA_mysql_query($local_query);
if ($result != FALSE && mysql_num_rows($result) > 0) {
?>
@@ -300,7 +304,7 @@ if (!empty($cfg['Server']['relation'])) {
<?php echo $strReferentialIntegrity; ?><br />
<?php
echo "\n";
while ($rel = mysql_fetch_row($result)) {
while ($rel = PMA_mysql_fetch_row($result)) {
echo ' '
. '<a href="sql.php3?' . $url_query
. '&amp;sql_query='

View File

@@ -19,13 +19,13 @@ if (isset($submitcomment)) {
}
if (empty($prev_comment) || urldecode($prev_comment) != $comment) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\'';
$result = mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
$message = $strSuccess;
}
}
if (isset($submittype)) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type;
$result = mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
$message = $strSuccess;
}
if (isset($submitoptions)) {
@@ -33,7 +33,7 @@ if (isset($submitoptions)) {
. (isset($pack_keys) ? ' pack_keys=1': ' pack_keys=0')
. (isset($checksum) ? ' checksum=1': ' checksum=0')
. (isset($delay_key_write) ? ' delay_key_write=1': ' delay_key_write=0');
$result = mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
$message = $strSuccess;
}
@@ -73,9 +73,9 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
<?php
// modify robbat2 code - staybyte - 11. June 2001
$query = 'SHOW VARIABLES LIKE \'have_%\'';
$result = mysql_query($query);
$result = PMA_mysql_query($query);
if ($result != FALSE && mysql_num_rows($result) > 0) {
while ($tmp = mysql_fetch_array($result)) {
while ($tmp = PMA_mysql_fetch_array($result)) {
if (isset($tmp['Variable_name'])) {
switch ($tmp['Variable_name']) {
case 'have_bdb':

View File

@@ -28,11 +28,11 @@ require('./tbl_properties_table_info.php3');
// 2. Gets table keys and retains them
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$primary = '';
$ret_keys = array();
$pk_array = array(); // will be use to emphasis prim. keys in the table view
while ($row = mysql_fetch_array($result)) {
while ($row = PMA_mysql_fetch_array($result)) {
$ret_keys[] = $row;
// Backups the list of primary keys
if ($row['Key_name'] == 'PRIMARY') {
@@ -44,7 +44,7 @@ mysql_free_result($result);
// 3. Get fields
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
$fields_rs = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$fields_cnt = mysql_num_rows($fields_rs);
@@ -78,7 +78,7 @@ $fields_cnt = mysql_num_rows($fields_rs);
$i = 0;
$aryFields = array();
while ($row = mysql_fetch_array($fields_rs)) {
while ($row = PMA_mysql_fetch_array($fields_rs)) {
$i++;
$bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
$aryFields[] = $row['Field'];

View File

@@ -8,8 +8,8 @@
// The 'show table' statement works correct since 3.23.03
if (PMA_MYSQL_INT_VERSION >= 32303) {
$local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$showtable = mysql_fetch_array($result);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$showtable = PMA_mysql_fetch_array($result);
$tbl_type = strtoupper($showtable['Type']);
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
@@ -27,9 +27,9 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
unset($tmp);
} else {
$local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table);
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$showtable = array();
$num_rows = mysql_result($result, 0, 'count');
$num_rows = PMA_mysql_result($result, 0, 'count');
$show_comment = '';
}
mysql_free_result($result);

View File

@@ -104,7 +104,7 @@ if ($row < 0) {
/**
* Prepares the form
*/
$tbl_result = mysql_list_tables($db);
$tbl_result = PMA_mysql_list_tables($db);
$tbl_result_cnt = mysql_num_rows($tbl_result);
$i = 0;
$k = 0;
@@ -118,8 +118,8 @@ if (!empty($TableList)) {
// The tables list gets from MySQL
while ($i < $tbl_result_cnt) {
$tbl = mysql_tablename($tbl_result, $i);
$fld_results = mysql_list_fields($db, $tbl);
$tbl = PMA_mysql_tablename($tbl_result, $i);
$fld_results = PMA_mysql_list_fields($db, $tbl);
$fld_results_cnt = mysql_num_fields($fld_results);
$j = 0;
@@ -133,7 +133,7 @@ while ($i < $tbl_result_cnt) {
if ($tbl_names[$tbl] == ' selected="selected"') {
$fld[$k++] = PMA_backquote($tbl) . '.*';
while ($j < $fld_results_cnt) {
$fld[$k] = mysql_field_name($fld_results, $j);
$fld[$k] = PMA_mysql_field_name($fld_results, $j);
$fld[$k] = PMA_backquote($tbl) . '.' . PMA_backquote($fld[$k]);
// increase the width if necessary
@@ -620,7 +620,7 @@ for ($x = 0; $x < $col; $x++) {
<?php
while (list($key, $val) = each($tbl_names)) {
echo ' ';
echo '<option value="' . urlencode($key) . '"' . $val . '>' . htmlspecialchars($key) . '</option>' . "\n";
echo '<option value="' . $key . '"' . $val . '>' . htmlspecialchars($key) . '</option>' . "\n";
}
?>
</select>
@@ -664,6 +664,7 @@ $w--;
<input type="submit" name="modify" value="<?php echo $strUpdateQuery; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
</td>
</tr>
<!-- Executes a query -->
@@ -728,8 +729,8 @@ if (isset($Field) && count($Field) > 0) {
}
} // end while
if ($cfg['Server']['relation']) {
$tables = @mysql_query('SELECT COUNT(*) AS count FROM ' . PMA_backquote($cfg['Server']['relation']));
$rel_work = ($tables) ? mysql_result($tables, 0, 'count') : FALSE;
$tables = @PMA_mysql_query('SELECT COUNT(*) AS count FROM ' . PMA_backquote($cfg['Server']['relation']));
$rel_work = ($tables) ? PMA_mysql_result($tables, 0, 'count') : FALSE;
} // end if
if ($rel_work && count($alltabs) > 0) {
@@ -773,10 +774,10 @@ if (isset($Field) && count($Field) > 0) {
. ' WHERE master_table IN ' . $incrit . ' AND foreign_table IN ' . $incrit
. ' GROUP BY master_table ORDER BY hits DESC';
$rel_id = @mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
$rel_id = @PMA_mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
// if we don't find anything we try the other way round
while ($row = mysql_fetch_array($rel_id)) {
while ($row = PMA_mysql_fetch_array($rel_id)) {
// we want the first one (highest number of hits) or the first one
// that is in the WHERE clause
if (!isset($master)) {
@@ -809,9 +810,9 @@ if (isset($Field) && count($Field) > 0) {
. ' WHERE master_table IN ' . $incrit . ' AND foreign_table IN ' . $incrit_s
. ' ORDER BY foreign_table, master_table';
$rel_id = @mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
$rel_id = @PMA_mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
while ($row = mysql_fetch_array($rel_id)) {
while ($row = PMA_mysql_fetch_array($rel_id)) {
$foreign_table = $row['foreign_table'];
if ($rel[$foreign_table]['mcon'] == 0) {
// if we already found a link to the mastertable we don't
@@ -843,12 +844,12 @@ if (isset($Field) && count($Field) > 0) {
$incrit_d = '(\'' . implode('\', \'', $found) . '\')';
$incrit_s = '(\'' . implode('\', \'', $rest) . '\')';
$rel_query = 'SELECT * FROM ' . $cfg['Server']['relation']
$rel_query = 'SELECT * FROM ' . PMA_backquote($cfg['Server']['relation'])
. ' WHERE master_table IN ' . $incrit_s . ' AND foreign_table IN ' . $incrit_d
. ' ORDER BY master_table, foreign_table';
$rel_id = @mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
$rel_id = @PMA_mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
while ($row = mysql_fetch_array($rel_id)) {
while ($row = PMA_mysql_fetch_array($rel_id)) {
$found_table = $row['master_table'];
if ($rel[$found_table]['mcon'] == 0) {
// if we allready found a link to the mastertable we
@@ -884,9 +885,9 @@ if (isset($Field) && count($Field) > 0) {
} else if ($varr['mcon'] == 0) {
// those that have no link with the mastertable we will
// show at the end
$lj .= $varr['link'];
$lj .= PMA_backquote($varr['link']);
} else {
$ljm .= $varr['link'];
$ljm .= PMA_backquote($varr['link']);
}
} // end while
@@ -909,7 +910,7 @@ if (isset($Field) && count($Field) > 0) {
while (list($k, $v) = each ($_temp)) {
$alltabs[] = $k;
}
$qry_from = implode(', ', $alltabs);
$qry_from = implode(', ', PMA_backquote($alltabs));
}
} // end count($Field) > 0

View File

@@ -19,9 +19,9 @@ if (!empty($cfg['Server']['relation'])
// first check if there is a entry allready
$upd_query = 'SELECT master_field, foreign_table, foreign_field FROM ' . PMA_backquote($cfg['Server']['relation'])
. ' WHERE master_table = \'' . PMA_sqlAddslashes($table) . '\'';
$upd_rs = mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
$upd_rs = PMA_mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
while ($foundrel = @mysql_fetch_array($upd_rs)) {
while ($foundrel = @PMA_mysql_fetch_array($upd_rs)) {
$currfield = $foundrel['master_field'];
$existrel[$currfield] = $foundrel['foreign_table'] . '.' . $foundrel['foreign_field'];
}
@@ -36,19 +36,19 @@ if (!empty($cfg['Server']['relation'])
. '\'' . PMA_sqlAddslashes($key) . '\', '
. '\'' . PMA_sqlAddslashes($for[0]) . '\', '
. '\'' . PMA_sqlAddslashes($for[1]) . '\')';
$upd_rs = mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
$upd_rs = PMA_mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
} else if ($existrel[$key] != $value) {
$for = explode('.', $destination[$key]);
$upd_query = 'UPDATE ' . PMA_backquote($cfg['Server']['relation']) . ' SET'
. ' foreign_table = \'' . PMA_sqlAddslashes($for[0]) . '\', foreign_field = \'' . PMA_sqlAddslashes($for[1]) . '\' '
. ' WHERE master_table = \'' . PMA_sqlAddslashes($table) . '\' AND master_field = \'' . PMA_sqlAddslashes($key) . '\'';
$upd_rs = mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
$upd_rs = PMA_mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
} // end if... else....
} else if (isset($existrel[$key])) {
$for = explode('.', $destination[$key]);
$upd_query = 'DELETE FROM ' . PMA_backquote($cfg['Server']['relation'])
. ' WHERE master_table = \'' . PMA_sqlAddslashes($table) . '\' AND master_field = \'' . PMA_sqlAddslashes($key) . '\'';
$upd_rs = mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
$upd_rs = PMA_mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
} // end if... else....
} // end while
} // end if
@@ -57,16 +57,16 @@ if (!empty($cfg['Server']['table_info'])
&& isset($submit_show) && $submit_show == 'true') {
$test_query = 'SELECT display_field FROM ' . PMA_backquote($cfg['Server']['table_info'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\'';
$test_rs = mysql_query($test_query) or PMA_mysqlDie('', $test_query, '', $err_url_0);
$test_rs = PMA_mysql_query($test_query) or PMA_mysqlDie('', $test_query, '', $err_url_0);
if ($test_rs && mysql_num_rows($test_rs) > 0) {
$upd_query = 'UPDATE ' . PMA_backquote($cfg['Server']['table_info']) . ' SET'
. ' display_field = \'' . PMA_sqlAddslashes($display_field) . '\''
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\'';
$upd_rs = mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
$upd_rs = PMA_mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0);
} else {
$ins_query = 'INSERT INTO ' . PMA_backquote($cfg['Server']['table_info']) . ' (table_name, display_field)'
. ' VALUES(\'' . PMA_sqlAddslashes($table) . '\', \'' . PMA_sqlAddslashes($display_field) .'\')';
$ins_rs = mysql_query($ins_query) or PMA_mysqlDie('', $ins_query, '', $err_url_0);
$ins_rs = PMA_mysql_query($ins_query) or PMA_mysqlDie('', $ins_query, '', $err_url_0);
}
} // end if
@@ -78,14 +78,14 @@ if ($cfg['Server']['relation']) {
$rel_work = FALSE;
// Mike Beck: get all Table-Fields to choose relation
$tab_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
$tab_rs = mysql_query($tab_query) or PMA_mysqlDie('', $tab_query, '', $err_url_0);
$tab_rs = PMA_mysql_query($tab_query) or PMA_mysqlDie('', $tab_query, '', $err_url_0);
$selectboxall['nix'] = '--';
while ($curr_table = @mysql_fetch_array($tab_rs)) {
while ($curr_table = @PMA_mysql_fetch_array($tab_rs)) {
if (($curr_table[0] != $table) && ($curr_table[0] != $cfg['Server']['relation'])) {
$fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[0]);
$fi_rs = mysql_query($fi_query) or PMA_mysqlDie('', $fi_query, '', $err_url_0);
$fi_rs = PMA_mysql_query($fi_query) or PMA_mysqlDie('', $fi_query, '', $err_url_0);
if ($fi_rs && mysql_num_rows($fi_rs) > 0) {
while ($curr_field = mysql_fetch_array($fi_rs)) {
while ($curr_field = PMA_mysql_fetch_array($fi_rs)) {
if (isset($curr_field['Key_name']) && $curr_field['Key_name'] == 'PRIMARY') {
$field_full = $curr_field['Table'] . '.' . $curr_field['Column_name'];
$field_v = $curr_field['Table'] . '->' . $curr_field['Column_name'];
@@ -112,9 +112,9 @@ if ($cfg['Server']['relation']) {
$rel_query = 'SELECT master_field, concat(foreign_table, \'.\', foreign_field) AS rel'
. ' FROM ' . PMA_backquote($cfg['Server']['relation'])
. ' WHERE master_table = \'' . PMA_sqlAddslashes($table) . '\'';
$relations = @mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
$relations = @PMA_mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url);
while ($relrow = @mysql_fetch_array($relations)) {
while ($relrow = @PMA_mysql_fetch_array($relations)) {
$rel_col = $relrow['master_field'];
$rel_dest[$rel_col] = $relrow['rel'];
} // end while
@@ -123,7 +123,7 @@ if ($cfg['Server']['relation']) {
// now find out the columns of our $table
$col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table);
$col_rs = mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0);
$col_rs = PMA_mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0);
if ($col_rs && mysql_num_rows($col_rs) > 0) {
?>
@@ -141,7 +141,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
</tr>
<?php
while ($row = mysql_fetch_array($col_rs)) {
while ($row = PMA_mysql_fetch_array($col_rs)) {
echo "\n";
?>
<tr>
@@ -183,8 +183,8 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
// Get "display_filed" infos
$disp_query = 'SELECT display_field FROM ' . PMA_backquote($cfg['Server']['table_info'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\'';
$disp_rs = mysql_query($disp_query) or PMA_mysqlDie('', $disp_query, '', $err_url_0);
$row = ($disp_rs ? mysql_fetch_array($disp_rs) : '');
$disp_rs = PMA_mysql_query($disp_query) or PMA_mysqlDie('', $disp_query, '', $err_url_0);
$row = ($disp_rs ? PMA_mysql_fetch_array($disp_rs) : '');
if (isset($row['display_field'])) {
$disp = $row['display_field'];
}
@@ -203,7 +203,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
<?php
echo "\n";
mysql_data_seek($col_rs, 0);
while ($row = @mysql_fetch_array($col_rs)) {
while ($row = @PMA_mysql_fetch_array($col_rs)) {
echo ' <option value="' . htmlspecialchars($row['Field']) . '"';
if (isset($disp) && $row['Field'] == $disp) {
echo ' selected="selected"';

View File

@@ -15,6 +15,7 @@ require('./libraries/common.lib.php3');
*/
$err_url = 'tbl_properties.php3'
. '?lang=' . $lang
. '&amp;convcharset=' . $convcharset
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table);
@@ -39,9 +40,9 @@ if (isset($new_name) && trim($new_name) != '') {
}
include('./header.inc.php3');
mysql_select_db($db);
PMA_mysql_select_db($db);
$sql_query = 'ALTER TABLE ' . PMA_backquote($old_name) . ' RENAME ' . PMA_backquote($new_name);
$result = mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
$message = sprintf($strRenameTableOK, $old_name, $table);
$reload = 1;
}

View File

@@ -20,6 +20,7 @@ $is_gotofile = FALSE;
if (isset($after_insert) && $after_insert == 'new_insert') {
$goto = 'tbl_change.php3'
. '?lang=' . $lang
. '&convcharset=' . $convcharset
. '&server=' . $server
. '&db=' . urlencode($db)
. '&table=' . urlencode($table)
@@ -32,6 +33,7 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
} else if ($goto == 'sql.php3') {
$goto = 'sql.php3?'
. 'lang=' . $lang
. '&convcharset=' . $convcharset
. '&server=' . $server
. '&db=' . urlencode($db)
. '&table=' . urlencode($table)
@@ -242,10 +244,10 @@ else {
*/
mysql_select_db($db);
$sql_query = $query . ';';
$result = mysql_query($query);
$result = PMA_mysql_query($query);
if (!$result) {
$error = mysql_error();
$error = PMA_mysql_error();
include('./header.inc.php3');
PMA_mysqlDie($error, '', '', $err_url);
} else {

Some files were not shown because too many files have changed in this diff Show More