use PMA_DBI function

This commit is contained in:
Marc Delisle
2004-01-20 19:53:53 +00:00
parent 8d5f4afa26
commit b0cc4dbb23
11 changed files with 23 additions and 23 deletions

View File

@@ -229,10 +229,10 @@ echo $header;
* Close MySql connections * Close MySql connections
*/ */
if (isset($dbh) && $dbh) { if (isset($dbh) && $dbh) {
@mysql_close($dbh); @PMA_DBI_close($dbh);
} }
if (isset($userlink) && $userlink) { if (isset($userlink) && $userlink) {
@mysql_close($userlink); @PMA_DBI_close($userlink);
} }

View File

@@ -82,7 +82,7 @@ while ($row = PMA_mysql_fetch_array($rowset)) {
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); $num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
if ($result) { if ($result) {
mysql_free_result($result); PMA_DBI_free_result($result);
} }
@@ -126,7 +126,7 @@ while ($row = PMA_mysql_fetch_array($rowset)) {
} // end while } // end while
if ($result) { if ($result) {
mysql_free_result($result); PMA_DBI_free_result($result);
} }
@@ -282,7 +282,7 @@ while ($row = PMA_mysql_fetch_array($rowset)) {
</tr> </tr>
<?php <?php
} // end while } // end while
mysql_free_result($result); PMA_DBI_free_result($result);
echo "\n"; echo "\n";
?> ?>

View File

@@ -28,7 +28,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
$sot_cache[$tmp[0]] = TRUE; $sot_cache[$tmp[0]] = TRUE;
} }
} }
mysql_free_result($db_info_result); PMA_DBI_free_result($db_info_result);
if (isset($sot_cache)) { if (isset($sot_cache)) {
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db); $local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
@@ -44,7 +44,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
$tables[] = array('Name' => $tmp[0]); $tables[] = array('Name' => $tmp[0]);
} }
} }
mysql_free_result($db_info_result); PMA_DBI_free_result($db_info_result);
$sot_ready = TRUE; $sot_ready = TRUE;
} }
} }
@@ -57,7 +57,7 @@ if (!isset($sot_ready)) {
while ($sts_tmp = PMA_mysql_fetch_array($db_info_result)) { while ($sts_tmp = PMA_mysql_fetch_array($db_info_result)) {
$tables[] = $sts_tmp; $tables[] = $sts_tmp;
} }
mysql_free_result($db_info_result); PMA_DBI_free_result($db_info_result);
} }
} }
$num_tables = (isset($tables) ? count($tables) : 0); $num_tables = (isset($tables) ? count($tables) : 0);

View File

@@ -159,7 +159,7 @@ while ($i < $tbl_result_cnt) {
$i++; $i++;
} // end if } // end if
mysql_free_result($tbl_result); PMA_DBI_free_result($tbl_result);
// largest width found // largest width found
$realwidth = $wid . 'ex'; $realwidth = $wid . 'ex';

View File

@@ -42,7 +42,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
$sot_cache[$tmp[0]] = TRUE; $sot_cache[$tmp[0]] = TRUE;
} }
} }
mysql_free_result($result); PMA_DBI_free_result($result);
if (isset($sot_cache)) { if (isset($sot_cache)) {
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db); $local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
@@ -58,7 +58,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
$tables[] = array('Name' => $tmp[0]); $tables[] = array('Name' => $tmp[0]);
} }
} }
mysql_free_result($result); PMA_DBI_free_result($result);
$sot_ready = TRUE; $sot_ready = TRUE;
} }
} }
@@ -71,7 +71,7 @@ if (!isset($sot_ready)) {
while ($sts_tmp = PMA_mysql_fetch_array($result)) { while ($sts_tmp = PMA_mysql_fetch_array($result)) {
$tables[] = $sts_tmp; $tables[] = $sts_tmp;
} }
mysql_free_result($result); PMA_DBI_free_result($result);
} }
} }
$num_tables = (isset($tables) ? count($tables) : 0); $num_tables = (isset($tables) ? count($tables) : 0);

View File

@@ -26,7 +26,7 @@ for ($i = 0; $i < $num_tables; $i++) {
$tables[] = PMA_mysql_tablename($list_tables, $i); $tables[] = PMA_mysql_tablename($list_tables, $i);
} }
if ($num_tables) { if ($num_tables) {
mysql_free_result($list_tables); PMA_DBI_free_result($list_tables);
} }
@@ -72,7 +72,7 @@ if (isset($submit_search)) {
$sqlstr_fieldstoselect = ' ' . implode(', ', $tblfields); $sqlstr_fieldstoselect = ' ' . implode(', ', $tblfields);
$tblfields_cnt = count($tblfields); $tblfields_cnt = count($tblfields);
if ($res) { if ($res) {
mysql_free_result($res); PMA_DBI_free_result($res);
} }
// Table to use // Table to use
@@ -191,7 +191,7 @@ if (isset($submit_search)) {
$res = @PMA_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) { if ($res) {
$res_cnt = PMA_mysql_result($res, 0, 'count'); $res_cnt = PMA_mysql_result($res, 0, 'count');
mysql_free_result($res); PMA_DBI_free_result($res);
} else { } else {
$res_cnt = 0; $res_cnt = 0;
} // end if... else ... } // end if... else ...
@@ -230,7 +230,7 @@ if (isset($submit_search)) {
$res = @PMA_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) { if ($res) {
$res_cnt = PMA_mysql_result($res, 0, 'count'); $res_cnt = PMA_mysql_result($res, 0, 'count');
mysql_free_result($res); PMA_DBI_free_result($res);
} else { } else {
$res_cnt = 0; $res_cnt = 0;
} // end if... else ... } // end if... else ...

View File

@@ -310,7 +310,7 @@ if (!$save_on_server) {
// Check if we have something to export // Check if we have something to export
if ($export_type == 'database') { if ($export_type == 'database') {
$tables = PMA_mysql_list_tables($db); $tables = PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0; $num_tables = ($tables) ? @PMA_DBI_num_rows($tables) : 0;
if ($num_tables == 0) { if ($num_tables == 0) {
$message = $strNoTablesFound; $message = $strNoTablesFound;
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
@@ -370,7 +370,7 @@ if ($export_type == 'server') {
PMA_exportDBHeader($current_db); PMA_exportDBHeader($current_db);
PMA_exportDBCreate($current_db); PMA_exportDBCreate($current_db);
$tables = PMA_mysql_list_tables($current_db); $tables = PMA_mysql_list_tables($current_db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0; $num_tables = ($tables) ? @PMA_DBI_num_rows($tables) : 0;
$i = 0; $i = 0;
while ($i < $num_tables) { while ($i < $num_tables) {
$table = PMA_mysql_tablename($tables, $i); $table = PMA_mysql_tablename($tables, $i);

View File

@@ -407,7 +407,7 @@ if ($num_dbs > 1) {
$selected_db = $j; $selected_db = $j;
} }
$tables = @PMA_mysql_list_tables($db); $tables = @PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0; $num_tables = ($tables) ? @PMA_DBI_num_rows($tables) : 0;
$common_url_query = PMA_generate_common_url($db); $common_url_query = PMA_generate_common_url($db);
if ($num_tables) { if ($num_tables) {
$num_tables_disp = $num_tables; $num_tables_disp = $num_tables;
@@ -619,7 +619,7 @@ if ($num_dbs > 1) {
else if ($num_dbs == 1) { else if ($num_dbs == 1) {
$db = $dblist[0]; $db = $dblist[0];
$tables = @PMA_mysql_list_tables($db); $tables = @PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0; $num_tables = ($tables) ? @PMA_DBI_num_rows($tables) : 0;
$common_url_query = PMA_generate_common_url($db); $common_url_query = PMA_generate_common_url($db);
if ($num_tables) { if ($num_tables) {
$num_tables_disp = $num_tables; $num_tables_disp = $num_tables;

View File

@@ -348,7 +348,7 @@ if ($goto == 'tbl_properties.php') {
} else { } else {
PMA_mysql_select_db($db); PMA_mysql_select_db($db);
$is_table = @PMA_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))) { if (!($is_table && @PMA_DBI_num_rows($is_table))) {
$goto = 'db_details.php'; $goto = 'db_details.php';
unset($table); unset($table);
} }

View File

@@ -559,7 +559,7 @@ else {
$goto = 'db_details.php'; $goto = 'db_details.php';
} else { } else {
$is_table = @PMA_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))) { if (!($is_table && @PMA_DBI_num_rows($is_table))) {
$goto = 'db_details.php'; $goto = 'db_details.php';
unset($table); unset($table);
} }

View File

@@ -40,7 +40,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
$is_table = @PMA_mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\''); $is_table = @PMA_mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
} }
if (empty($table) if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) { || !($is_table && @PMA_DBI_num_rows($is_table))) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit; exit;
} else if (isset($is_table)) { } else if (isset($is_table)) {