use PMA_DBI function
This commit is contained in:
@@ -592,7 +592,7 @@ function PMA_safe_db_list($only_db_check, $dbh, $dblist_cnt, $rs, $userlink, $cf
|
|||||||
if (!$dblist_cnt
|
if (!$dblist_cnt
|
||||||
&& ($rs && @PMA_DBI_num_rows($rs))) {
|
&& ($rs && @PMA_DBI_num_rows($rs))) {
|
||||||
$row = PMA_mysql_fetch_array($rs);
|
$row = PMA_mysql_fetch_array($rs);
|
||||||
mysql_free_result($rs);
|
PMA_DBI_free_result($rs);
|
||||||
// Correction uva 19991215
|
// Correction uva 19991215
|
||||||
// Previous code assumed database "mysql" admin table "db" column
|
// Previous code assumed database "mysql" admin table "db" column
|
||||||
// "db" contains literal name of user database, and works if so.
|
// "db" contains literal name of user database, and works if so.
|
||||||
@@ -631,7 +631,7 @@ function PMA_safe_db_list($only_db_check, $dbh, $dblist_cnt, $rs, $userlink, $cf
|
|||||||
$uva_mydbs[$row['Db']] = 1;
|
$uva_mydbs[$row['Db']] = 1;
|
||||||
}
|
}
|
||||||
} // end while
|
} // end while
|
||||||
mysql_free_result($rs);
|
PMA_DBI_free_result($rs);
|
||||||
$uva_alldbs = mysql_list_dbs($GLOBALS['dbh']);
|
$uva_alldbs = mysql_list_dbs($GLOBALS['dbh']);
|
||||||
// loic1: all databases cases - part 2
|
// loic1: all databases cases - part 2
|
||||||
if (isset($uva_mydbs['%'])) {
|
if (isset($uva_mydbs['%'])) {
|
||||||
@@ -662,7 +662,7 @@ function PMA_safe_db_list($only_db_check, $dbh, $dblist_cnt, $rs, $userlink, $cf
|
|||||||
} // end if ... else if....
|
} // end if ... else if....
|
||||||
} // end while
|
} // end while
|
||||||
} // end else
|
} // end else
|
||||||
mysql_free_result($uva_alldbs);
|
PMA_DBI_free_result($uva_alldbs);
|
||||||
unset($uva_mydbs);
|
unset($uva_mydbs);
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
@@ -675,7 +675,7 @@ function PMA_safe_db_list($only_db_check, $dbh, $dblist_cnt, $rs, $userlink, $cf
|
|||||||
$dblist[] = $row['Db'];
|
$dblist[] = $row['Db'];
|
||||||
}
|
}
|
||||||
} // end while
|
} // end while
|
||||||
mysql_free_result($rs);
|
PMA_DBI_free_result($rs);
|
||||||
} // end if
|
} // end if
|
||||||
} // end if
|
} // end if
|
||||||
} // end building available dbs from the "mysql" db
|
} // end building available dbs from the "mysql" db
|
||||||
@@ -1059,7 +1059,7 @@ if ($is_minimum_common == FALSE) {
|
|||||||
$true_dblist[] = $row[0];
|
$true_dblist[] = $row[0];
|
||||||
} // end while
|
} // end while
|
||||||
if ($rs) {
|
if ($rs) {
|
||||||
mysql_free_result($rs);
|
PMA_DBI_free_result($rs);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$true_dblist[] = str_replace('\\_', '_', str_replace('\\%', '%', $dblist[$i]));
|
$true_dblist[] = str_replace('\\_', '_', str_replace('\\%', '%', $dblist[$i]));
|
||||||
@@ -1252,12 +1252,12 @@ if ($is_minimum_common == FALSE) {
|
|||||||
if ($num < $cfg['MaxExactCount']) {
|
if ($num < $cfg['MaxExactCount']) {
|
||||||
unset($num);
|
unset($num);
|
||||||
}
|
}
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
if (!isset($num)) {
|
if (!isset($num)) {
|
||||||
$result = PMA_mysql_query('SELECT COUNT(*) AS num FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)) or PMA_mysqlDie('', $local_query, '', $err_url);
|
$result = PMA_mysql_query('SELECT COUNT(*) AS num FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)) or PMA_mysqlDie('', $local_query, '', $err_url);
|
||||||
$num = ($result) ? PMA_mysql_result($result, 0, 'num') : 0;
|
$num = ($result) ? PMA_mysql_result($result, 0, 'num') : 0;
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
}
|
}
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
return $num;
|
return $num;
|
||||||
@@ -1309,7 +1309,7 @@ if (typeof(window.parent) != 'undefined'
|
|||||||
? ''
|
? ''
|
||||||
: $tbl_status['Comment'] . ' ';
|
: $tbl_status['Comment'] . ' ';
|
||||||
$tooltip .= '(' . $tbl_status['Rows'] . ' ' . $GLOBALS['strRows'] . ')';
|
$tooltip .= '(' . $tbl_status['Rows'] . ' ' . $GLOBALS['strRows'] . ')';
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
$md5_tbl = md5($GLOBALS['table']);
|
$md5_tbl = md5($GLOBALS['table']);
|
||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
@@ -1336,7 +1336,7 @@ if (typeof(document.getElementById) != 'undefined'
|
|||||||
$result = @PMA_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) {
|
if ($result) {
|
||||||
$tbl_status = PMA_mysql_fetch_array($result, MYSQL_ASSOC);
|
$tbl_status = PMA_mysql_fetch_array($result, MYSQL_ASSOC);
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($tbl_status) && (int) $tbl_status['Index_length'] > 1024) {
|
if (isset($tbl_status) && (int) $tbl_status['Index_length'] > 1024) {
|
||||||
|
@@ -31,7 +31,7 @@ if (!isset($is_table) || !$is_table) {
|
|||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
} else if (isset($is_table)) {
|
} else if (isset($is_table)) {
|
||||||
mysql_free_result($is_table);
|
PMA_DBI_free_result($is_table);
|
||||||
}
|
}
|
||||||
} // end if (ensures table exists)
|
} // end if (ensures table exists)
|
||||||
?>
|
?>
|
||||||
|
@@ -163,7 +163,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
} // end for
|
} // end for
|
||||||
if (!PMA_exportOutputHandler($schema_insert . $add_character)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert . $add_character)) return FALSE;
|
||||||
} // end while
|
} // end while
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} // end of the 'PMA_getTableCsv()' function
|
} // end of the 'PMA_getTableCsv()' function
|
||||||
|
@@ -184,7 +184,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$buffer = ' \\end{longtable}' . $crlf;
|
$buffer = ' \\end{longtable}' . $crlf;
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
||||||
|
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
} // end getTableLaTeX
|
} // end getTableLaTeX
|
||||||
@@ -378,7 +378,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
|
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
||||||
} // end while
|
} // end while
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
$buffer = ' \\end{longtable}' . $crlf;
|
$buffer = ' \\end{longtable}' . $crlf;
|
||||||
return PMA_exportOutputHandler($buffer);
|
return PMA_exportOutputHandler($buffer);
|
||||||
|
@@ -176,7 +176,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
$schema_create .= '# ' . $GLOBALS['strStatCheckTime'] . ': ' . PMA_localisedDate(strtotime($tmpres['Check_time'])) . $crlf;
|
$schema_create .= '# ' . $GLOBALS['strStatCheckTime'] . ': ' . PMA_localisedDate(strtotime($tmpres['Check_time'])) . $crlf;
|
||||||
$new_crlf = '#' . $crlf . $crlf;
|
$new_crlf = '#' . $crlf . $crlf;
|
||||||
}
|
}
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
$schema_create .= $auto_increment;
|
$schema_create .= $auto_increment;
|
||||||
|
|
||||||
|
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
return $schema_create;
|
return $schema_create;
|
||||||
} // end of the 'PMA_getTableDef()' function
|
} // end of the 'PMA_getTableDef()' function
|
||||||
|
|
||||||
@@ -521,7 +521,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
|
|
||||||
} // end while
|
} // end while
|
||||||
} // end if ($result != FALSE)
|
} // end if ($result != FALSE)
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} // end of the 'PMA_exportData()' function
|
} // end of the 'PMA_exportData()' function
|
||||||
|
@@ -137,7 +137,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
|
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
||||||
}
|
}
|
||||||
mysql_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} // end of the 'PMA_getTableXML()' function
|
} // end of the 'PMA_getTableXML()' function
|
||||||
|
@@ -13,7 +13,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
|||||||
$mysql_charsets_maxlen[$row['Charset']] = $row['Maxlen'];
|
$mysql_charsets_maxlen[$row['Charset']] = $row['Maxlen'];
|
||||||
$mysql_charsets_descriptions[$row['Charset']] = $row['Description'];
|
$mysql_charsets_descriptions[$row['Charset']] = $row['Description'];
|
||||||
}
|
}
|
||||||
@mysql_free_result($res);
|
@PMA_DBI_free_result($res);
|
||||||
unset($res, $row);
|
unset($res, $row);
|
||||||
|
|
||||||
$res = PMA_mysql_query('SHOW COLLATION;', $userlink)
|
$res = PMA_mysql_query('SHOW COLLATION;', $userlink)
|
||||||
@@ -43,7 +43,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
|||||||
reset($mysql_collations[$key]);
|
reset($mysql_collations[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@mysql_free_result($res);
|
@PMA_DBI_free_result($res);
|
||||||
unset($res, $row);
|
unset($res, $row);
|
||||||
|
|
||||||
function PMA_getCollationDescr($collation) {
|
function PMA_getCollationDescr($collation) {
|
||||||
@@ -236,7 +236,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
|||||||
$sql_query = 'SHOW CREATE DATABASE `' . $db . '`;';
|
$sql_query = 'SHOW CREATE DATABASE `' . $db . '`;';
|
||||||
$res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
|
$res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
|
||||||
$row = PMA_mysql_fetch_row($res);
|
$row = PMA_mysql_fetch_row($res);
|
||||||
mysql_free_result($res);
|
PMA_DBI_free_result($res);
|
||||||
$tokenized = explode(' ', $row[1]);
|
$tokenized = explode(' ', $row[1]);
|
||||||
unset($row, $res, $sql_query);
|
unset($row, $res, $sql_query);
|
||||||
|
|
||||||
|
@@ -185,7 +185,7 @@ function PMA_getRelationsParam($verbose = FALSE)
|
|||||||
$cfgRelation['allworks'] = TRUE;
|
$cfgRelation['allworks'] = TRUE;
|
||||||
}
|
}
|
||||||
if ($tab_rs) {
|
if ($tab_rs) {
|
||||||
mysql_free_result($tab_rs);
|
PMA_DBI_free_result($tab_rs);
|
||||||
} else {
|
} else {
|
||||||
$cfg['Server']['pmadb'] = FALSE;
|
$cfg['Server']['pmadb'] = FALSE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user