From 2915b5c3cea54b55d85f1b15029808480952b87d Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 22 Jan 2004 02:13:48 +0000 Subject: Added MySQLi library; Removed calls to old mysql_wrappers library. --- tbl_printview.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'tbl_printview.php') diff --git a/tbl_printview.php b/tbl_printview.php index e9684c3a18..9ddac745c7 100644 --- a/tbl_printview.php +++ b/tbl_printview.php @@ -38,7 +38,7 @@ if (isset($table)) { /** * Selects the database */ -PMA_mysql_select_db($db); +PMA_DBI_select_db($db); /** @@ -79,21 +79,17 @@ foreach($the_tables AS $key => $table) { /** * Gets table informations */ - $local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\''; - $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); - $showtable = PMA_mysql_fetch_array($result); + $result = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';'); + $showtable = PMA_DBI_fetch_assoc($result); $num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); - if ($result) { - PMA_DBI_free_result($result); - } + PMA_DBI_free_result($result); /** * Gets table keys and retains them */ - $local_query = 'SHOW KEYS FROM ' . PMA_backquote($table); - $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); + $result = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($table) . ';'); $primary = ''; $indexes = array(); $lastIndex = ''; @@ -101,7 +97,7 @@ foreach($the_tables AS $key => $table) { $indexes_data = array(); $pk_array = array(); // will be use to emphasis prim. keys in the table // view - while ($row = PMA_mysql_fetch_array($result)) { + while ($row = PMA_DBI_fetch_assoc($result)) { // Backups the list of primary keys if ($row['Key_name'] == 'PRIMARY') { $primary .= $row['Column_name'] . ', '; @@ -135,8 +131,7 @@ foreach($the_tables AS $key => $table) { /** * Gets fields properties */ - $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table); - $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); + $result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';'); $fields_cnt = PMA_DBI_num_rows($result); // Check if we can use Relations (Mike Beck) @@ -193,7 +188,7 @@ foreach($the_tables AS $key => $table) {