Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2004-01-20 22:35:37 +0300
committerMarc Delisle <marc@infomarc.info>2004-01-20 22:35:37 +0300
commit28a5d0476e8894aa18949910e7cceb3fbe36a7ad (patch)
tree0a39a8773f0b115069b8e753f9dc0c2e06350eaa
parent0c31d7c7a8fef79ee1d30d41b54163c9f1da0e66 (diff)
PMA_DBI_num_rows
-rwxr-xr-xChangeLog3
-rw-r--r--db_datadict.php3
-rw-r--r--db_details_db_info.php6
-rw-r--r--db_details_qbe.php2
-rw-r--r--db_details_structure.php2
-rw-r--r--db_printview.php6
-rw-r--r--db_search.php4
-rw-r--r--ldi_table.php2
-rw-r--r--libraries/bookmark.lib.php2
-rw-r--r--libraries/display_tbl.lib.php6
-rw-r--r--libraries/export/latex.php4
-rw-r--r--libraries/export/sql.php6
-rw-r--r--libraries/relation.lib.php2
-rw-r--r--libraries/transformations.lib.php2
-rw-r--r--pdf_pages.php8
-rw-r--r--pdf_schema.php12
-rw-r--r--read_dump.php2
-rw-r--r--sql.php4
-rw-r--r--tbl_change.php2
-rw-r--r--tbl_indexes.php4
-rw-r--r--tbl_printview.php2
-rw-r--r--tbl_properties.inc.php2
-rw-r--r--tbl_properties_operations.php2
-rw-r--r--tbl_properties_structure.php2
-rw-r--r--tbl_relation.php10
-rw-r--r--tbl_select.php2
26 files changed, 52 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog
index 786d383787..42ec760208 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
+2004-01-20 Marc Delisle <lem9@users.sourceforge.net>
+ * lots of scripts: PMA_DBI_num_rows()
+
2004-01-19 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php, libraries/dbi/mysql.dbi.lib.php:
PMA_DBI_get_dblist()
diff --git a/db_datadict.php b/db_datadict.php
index 025e39bfd1..b319c7add7 100644
--- a/db_datadict.php
+++ b/db_datadict.php
@@ -135,8 +135,7 @@ while ($row = mysql_fetch_array($rowset)) {
*/
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
- $fields_cnt = mysql_num_rows($result);
-
+ $fields_cnt = PMA_DBI_num_rows($result);
// Check if we can use Relations (Mike Beck)
if (!empty($cfgRelation['relation'])) {
// Find which tables are related with the current one and write it in
diff --git a/db_details_db_info.php b/db_details_db_info.php
index ac150773ee..113d262096 100644
--- a/db_details_db_info.php
+++ b/db_details_db_info.php
@@ -21,7 +21,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
// Blending out tables in use
- if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
+ if ($db_info_result != FALSE && PMA_DBI_num_rows($db_info_result) > 0) {
while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
// if in use memorize tablename
if (preg_match('@in_use=[1-9]+@i', $tmp[1])) {
@@ -33,7 +33,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
if (isset($sot_cache)) {
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
- if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
+ if ($db_info_result != FALSE && PMA_DBI_num_rows($db_info_result) > 0) {
while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
if (!isset($sot_cache[$tmp[0]])) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\'';
@@ -53,7 +53,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
if (!isset($sot_ready)) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
- if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
+ if ($db_info_result != FALSE && PMA_DBI_num_rows($db_info_result) > 0) {
while ($sts_tmp = PMA_mysql_fetch_array($db_info_result)) {
$tables[] = $sts_tmp;
}
diff --git a/db_details_qbe.php b/db_details_qbe.php
index 463e3f7f43..c25968f93d 100644
--- a/db_details_qbe.php
+++ b/db_details_qbe.php
@@ -115,7 +115,7 @@ if ($row < 0) {
* Prepares the form
*/
$tbl_result = PMA_mysql_list_tables($db);
-$tbl_result_cnt = mysql_num_rows($tbl_result);
+$tbl_result_cnt = PMA_DBI_num_rows($tbl_result);
$i = 0;
$k = 0;
diff --git a/db_details_structure.php b/db_details_structure.php
index 3f7e5b4588..67071096b8 100644
--- a/db_details_structure.php
+++ b/db_details_structure.php
@@ -650,7 +650,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) {
$test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
$test_rs = PMA_query_as_cu($test_query);
- if ($test_rs && mysql_num_rows($test_rs) > 0) {
+ if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) {
echo "\n";
?>
<li>
diff --git a/db_printview.php b/db_printview.php
index fdf77c983f..4e592696a6 100644
--- a/db_printview.php
+++ b/db_printview.php
@@ -35,7 +35,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
// Blending out tables in use
- if ($result != FALSE && mysql_num_rows($result) > 0) {
+ if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
while ($tmp = PMA_mysql_fetch_array($result)) {
// if in use memorize tablename
if (preg_match('@in_use=[1-9]+@i', $tmp[0])) {
@@ -47,7 +47,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
if (isset($sot_cache)) {
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
- if ($result != FALSE && mysql_num_rows($result) > 0) {
+ if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
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]) . '\'';
@@ -67,7 +67,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
if (!isset($sot_ready)) {
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
- if ($result != FALSE && mysql_num_rows($result) > 0) {
+ if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
while ($sts_tmp = PMA_mysql_fetch_array($result)) {
$tables[] = $sts_tmp;
}
diff --git a/db_search.php b/db_search.php
index 0ffd67cc8b..5f68ee95d8 100644
--- a/db_search.php
+++ b/db_search.php
@@ -21,7 +21,7 @@ $url_query .= '&amp;goto=db_search.php';
* Get the list of tables from the current database
*/
$list_tables = PMA_mysql_list_tables($db);
-$num_tables = ($list_tables ? mysql_num_rows($list_tables) : 0);
+$num_tables = ($list_tables ? PMA_DBI_num_rows($list_tables) : 0);
for ($i = 0; $i < $num_tables; $i++) {
$tables[] = PMA_mysql_tablename($list_tables, $i);
}
@@ -65,7 +65,7 @@ if (isset($submit_search)) {
// Fields to select
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']);
$res = @PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, FALSE, $err_url);
- $res_cnt = ($res ? mysql_num_rows($res) : 0);
+ $res_cnt = ($res ? PMA_DBI_num_rows($res) : 0);
for ($i = 0; $i < $res_cnt; $i++) {
$tblfields[] = PMA_backquote(PMA_mysql_result($res, $i, 'field'));
} // end if
diff --git a/ldi_table.php b/ldi_table.php
index 32f5a29623..3d29b855cf 100644
--- a/ldi_table.php
+++ b/ldi_table.php
@@ -154,7 +154,7 @@ if (PMA_MYSQL_INT_VERSION < 32349) {
if (PMA_MYSQL_INT_VERSION > 40003) {
$tmp_query = "SHOW VARIABLES LIKE 'local\\_infile'";
$result = PMA_mysql_query($tmp_query);
- if ($result != FALSE && mysql_num_rows($result) > 0) {
+ if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
$tmp = PMA_mysql_fetch_row($result);
if ($tmp[1] == 'ON') {
$local_option_selected = TRUE;
diff --git a/libraries/bookmark.lib.php b/libraries/bookmark.lib.php
index ca36c73ba0..3a3a9a68e2 100644
--- a/libraries/bookmark.lib.php
+++ b/libraries/bookmark.lib.php
@@ -58,7 +58,7 @@ function PMA_listBookmarks($db, $cfgBookmark)
}
// There is some bookmarks -> store them
- if ($result > 0 && mysql_num_rows($result) > 0) {
+ if ($result > 0 && PMA_DBI_num_rows($result) > 0) {
$flag = 1;
while ($row = PMA_mysql_fetch_row($result)) {
$bookmark_list[$flag . ' - ' . $row[0]] = $row[1];
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 3c91c6bb34..dee4a4f18d 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -487,7 +487,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// grab indexes data:
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
- $idx_cnt = mysql_num_rows($result);
+ $idx_cnt = PMA_DBI_num_rows($result);
$prev_index = '';
for ($i = 0; $i < $idx_cnt; $i++) {
@@ -1301,7 +1301,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. ' = ' . $row[$pointer];
$dispresult = PMA_mysql_query($dispsql);
- if ($dispresult && mysql_num_rows($dispresult) > 0) {
+ if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
$dispval = PMA_mysql_result($dispresult, 0);
}
else {
@@ -1428,7 +1428,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. ' = \'' . PMA_sqlAddslashes($row[$pointer]) . '\'';
$dispresult = @PMA_mysql_query($dispsql);
- if ($dispresult && mysql_num_rows($dispresult) > 0) {
+ if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
$dispval = PMA_mysql_result($dispresult, 0);
}
else {
diff --git a/libraries/export/latex.php b/libraries/export/latex.php
index 506407febe..9fec3e09e6 100644
--- a/libraries/export/latex.php
+++ b/libraries/export/latex.php
@@ -215,7 +215,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
PMA_mysql_select_db($db);
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
- $fields_cnt = mysql_num_rows($result);
+ $fields_cnt = PMA_DBI_num_rows($result);
// Check if we can use Relations (Mike Beck)
if ($do_relation && !empty($cfgRelation['relation'])) {
@@ -383,4 +383,4 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
$buffer = ' \\end{longtable}' . $crlf;
return PMA_exportOutputHandler($buffer);
} // end of the 'PMA_getTableStructureLaTeX()' function
-?> \ No newline at end of file
+?>
diff --git a/libraries/export/sql.php b/libraries/export/sql.php
index 19a1f8859a..c3b2070d46 100644
--- a/libraries/export/sql.php
+++ b/libraries/export/sql.php
@@ -156,7 +156,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
$result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table) . '\'');
if ($result != FALSE) {
- if (mysql_num_rows($result) > 0) {
+ if (PMA_DBI_num_rows($result) > 0) {
$tmpres = PMA_mysql_fetch_array($result);
if (isset($GLOBALS['auto_increment']) && !empty($tmpres['Auto_increment'])) {
$auto_increment .= ' AUTO_INCREMENT=' . $tmpres['Auto_increment'] . ' ';
@@ -194,7 +194,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
PMA_mysql_query('SET SQL_QUOTE_SHOW_CREATE = 0');
}
$result = PMA_mysql_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table));
- if ($result != FALSE && mysql_num_rows($result) > 0) {
+ if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
$tmpres = PMA_mysql_fetch_array($result);
// Fix for case problems with winwin, thanks to
// Paweł Szczepański <pauluz at users.sourceforge.net>
@@ -398,7 +398,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $error_url);
if ($result != FALSE) {
$fields_cnt = mysql_num_fields($result);
- $rows_cnt = mysql_num_rows($result);
+ $rows_cnt = PMA_DBI_num_rows($result);
// get the real types of the table's fields (in an array)
// the key of the array is the backquoted field name
diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php
index 2cb26e03e9..c52cf21368 100644
--- a/libraries/relation.lib.php
+++ b/libraries/relation.lib.php
@@ -470,7 +470,7 @@ function PMA_setComment($db, $table, $key, $value, $removekey = '') {
. ' AND column_name = \'' . PMA_sqlAddslashes($key) . '\'';
$test_rs = PMA_query_as_cu($test_qry);
- if ($test_rs && mysql_num_rows($test_rs) > 0) {
+ if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) {
$row = @PMA_mysql_fetch_array($test_rs);
if (strlen($value) > 0 || strlen($row['mimetype']) > 0 || strlen($row['transformation']) > 0 || strlen($row['transformation_options']) > 0) {
diff --git a/libraries/transformations.lib.php b/libraries/transformations.lib.php
index 6cb1d12a87..daca140f3f 100644
--- a/libraries/transformations.lib.php
+++ b/libraries/transformations.lib.php
@@ -136,7 +136,7 @@ function PMA_setMIME($db, $table, $key, $mimetype, $transformation, $transformat
. ' AND column_name = \'' . PMA_sqlAddslashes($key) . '\'';
$test_rs = PMA_query_as_cu($test_qry);
- if ($test_rs && mysql_num_rows($test_rs) > 0) {
+ if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) {
$row = @PMA_mysql_fetch_array($test_rs);
if (!$forcedelete && (strlen($mimetype) > 0 || strlen($transformation) > 0 || strlen($transformation_options) > 0 || strlen($row['comment']) > 0)) {
diff --git a/pdf_pages.php b/pdf_pages.php
index 5151c91ce9..5818f76f97 100644
--- a/pdf_pages.php
+++ b/pdf_pages.php
@@ -91,7 +91,7 @@ if ($cfgRelation['pdfwork']) {
. ' GROUP BY master_table'
. ' ORDER BY ' . PMA_backquote('COUNT(master_table)') . ' DESC ';
$master_tables_rs = PMA_query_as_cu($master_tables);
- if ($master_tables_rs && mysql_num_rows($master_tables_rs) > 0) {
+ if ($master_tables_rs && PMA_DBI_num_rows($master_tables_rs) > 0) {
// first put all the master tables at beginning
// of the list, so they are near the center of
// the schema
@@ -185,7 +185,7 @@ if ($cfgRelation['pdfwork']) {
. ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
. ' AND pdf_page_number = ' . $chpage;
$test_rs = PMA_query_as_cu($test_query);
- if ($test_rs && mysql_num_rows($test_rs) > 0) {
+ if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) {
if (isset($arrvalue['delete']) && $arrvalue['delete'] == 'y') {
$ch_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords'])
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
@@ -232,7 +232,7 @@ if ($cfgRelation['pdfwork']) {
$page_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
$page_rs = PMA_query_as_cu($page_query);
- if ($page_rs && mysql_num_rows($page_rs) > 0) {
+ if ($page_rs && PMA_DBI_num_rows($page_rs) > 0) {
?>
<form method="get" action="pdf_pages.php" name="selpage">
<?php echo $strChoosePage . "\n"; ?>
@@ -323,7 +323,7 @@ foreach($array_sh_page AS $key => $temp_sh_page) {
. PMA_backquote($temp_sh_page['table_name'] )
. ' FROM ' . PMA_backquote($db);
$fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
- $fields_cnt = mysql_num_rows($fields_rs);
+ $fields_cnt = PMA_DBI_num_rows($fields_rs);
echo '<div id="table_' . $i . '" class="pdflayout_table"><u>' . $temp_sh_page['table_name'] . '</u>';
while ($row = PMA_mysql_fetch_array($fields_rs)) {
diff --git a/pdf_schema.php b/pdf_schema.php
index 64af8eb9c1..092de2a701 100644
--- a/pdf_schema.php
+++ b/pdf_schema.php
@@ -684,7 +684,7 @@ class PMA_RT_Table
$this->table_name = $table_name;
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
$result = PMA_mysql_query($sql);
- if (!$result || !mysql_num_rows($result)) {
+ if (!$result || !PMA_DBI_num_rows($result)) {
$pdf->PMA_PDF_die(sprintf($GLOBALS['strPdfInvalidTblName'], $table_name));
}
// load fields
@@ -707,7 +707,7 @@ class PMA_RT_Table
. ' AND pdf_page_number = ' . $pdf_page_number;
$result = PMA_query_as_cu($sql);
- if (!$result || !mysql_num_rows($result)) {
+ if (!$result || !PMA_DBI_num_rows($result)) {
$pdf->PMA_PDF_die(sprintf($GLOBALS['strConfigureTableCoord'], $table_name));
}
list($this->x, $this->y) = PMA_mysql_fetch_array($result);
@@ -719,7 +719,7 @@ class PMA_RT_Table
// index
$sql = 'SHOW index FROM ' . PMA_backquote($table_name);
$result = PMA_mysql_query($sql);
- if ($result && mysql_num_rows($result) > 0) {
+ if ($result && PMA_DBI_num_rows($result) > 0) {
while ($row = PMA_mysql_fetch_array($result)) {
if ($row['Key_name'] == 'PRIMARY') {
$this->primary[] = $row['Column_name'];
@@ -1108,7 +1108,7 @@ class PMA_RT
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
. ' AND pdf_page_number = ' . $which_rel;
$tab_rs = PMA_query_as_cu($tab_sql);
- if (!$tab_rs || !mysql_num_rows($tab_rs) > 0) {
+ if (!$tab_rs || !PMA_DBI_num_rows($tab_rs) > 0) {
$pdf->PMA_PDF_die($GLOBALS['strPdfNoTables']);
// die('No tables');
}
@@ -1198,7 +1198,7 @@ class PMA_RT
// loic1: also show tables without relations
// $norelations = TRUE;
-// if ($result && mysql_num_rows($result) > 0) {
+// if ($result && PMA_DBI_num_rows($result) > 0) {
// $norelations = FALSE;
// while ($row = PMA_mysql_fetch_array($result)) {
// $this->PMA_RT_addRelation($row['master_table'] , $row['master_field'], $row['foreign_table'], $row['foreign_field']);
@@ -1335,7 +1335,7 @@ function PMA_RT_DOC($alltables ){
*/
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
- $fields_cnt = mysql_num_rows($result);
+ $fields_cnt = PMA_DBI_num_rows($result);
// Check if we can use Relations (Mike Beck)
diff --git a/read_dump.php b/read_dump.php
index a8e9771b84..f12bee6055 100644
--- a/read_dump.php
+++ b/read_dump.php
@@ -277,7 +277,7 @@ if ($sql_query != '') {
break;
}
} else if ($cfg['VerboseMultiSubmit']) {
- $a_num_rows = (int)@mysql_num_rows($result);
+ $a_num_rows = (int)@PMA_DBI_num_rows($result);
$a_aff_rows = (int)@mysql_affected_rows();
if ($a_num_rows > 0) {
$a_rows = $a_num_rows;
diff --git a/sql.php b/sql.php
index b9d84fab79..87cb03bb3f 100644
--- a/sql.php
+++ b/sql.php
@@ -336,7 +336,7 @@ else {
// mysql_affected_rows() reports about the last query done)
if (!$is_affected) {
- $num_rows = ($result) ? @mysql_num_rows($result) : 0;
+ $num_rows = ($result) ? @PMA_DBI_num_rows($result) : 0;
} else if (!isset($num_rows)) {
$num_rows = @mysql_affected_rows();
}
@@ -459,7 +459,7 @@ else {
if (PMA_MYSQL_INT_VERSION < 40000) {
if ($cnt_all_result = PMA_mysql_query($count_query)) {
if ($is_group && $count_what == '*') {
- $unlim_num_rows = @mysql_num_rows($cnt_all_result);
+ $unlim_num_rows = @PMA_DBI_num_rows($cnt_all_result);
} else {
$unlim_num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
}
diff --git a/tbl_change.php b/tbl_change.php
index 76e201b8ab..52a77dd01d 100644
--- a/tbl_change.php
+++ b/tbl_change.php
@@ -193,7 +193,7 @@ if ($cfg['PropertiesIconic'] == true) {
// Set if we passed the first timestamp field
$timestamp_seen = 0;
-$fields_cnt = mysql_num_rows($table_def);
+$fields_cnt = PMA_DBI_num_rows($table_def);
// Set a flag here because the 'if' would not be valid in the loop
// if we set a value in some field
diff --git a/tbl_indexes.php b/tbl_indexes.php
index 371ec4d517..82956adee0 100644
--- a/tbl_indexes.php
+++ b/tbl_indexes.php
@@ -71,7 +71,7 @@ if (defined('PMA_IDX_INCLUDED')) {
} else {
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
- $idx_cnt = mysql_num_rows($result);
+ $idx_cnt = PMA_DBI_num_rows($result);
}
for ($i = 0; $i < $idx_cnt; $i++) {
@@ -114,7 +114,7 @@ if (defined('PMA_IDX_INCLUDED')) {
} else {
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
$fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
- $fields_cnt = mysql_num_rows($fields_rs);
+ $fields_cnt = PMA_DBI_num_rows($fields_rs);
}
$fields_names = array();
diff --git a/tbl_printview.php b/tbl_printview.php
index 280f78c4da..9503d0a372 100644
--- a/tbl_printview.php
+++ b/tbl_printview.php
@@ -137,7 +137,7 @@ foreach($the_tables AS $key => $table) {
*/
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
- $fields_cnt = mysql_num_rows($result);
+ $fields_cnt = PMA_DBI_num_rows($result);
// Check if we can use Relations (Mike Beck)
if (!empty($cfgRelation['relation'])) {
diff --git a/tbl_properties.inc.php b/tbl_properties.inc.php
index cdf9260745..94b66d3751 100644
--- a/tbl_properties.inc.php
+++ b/tbl_properties.inc.php
@@ -560,7 +560,7 @@ if ($action == 'tbl_create.php') {
// find mysql capability - staybyte - 11. June 2001
$query = 'SHOW VARIABLES LIKE \'have_%\'';
$result = PMA_mysql_query($query);
- if ($result != FALSE && mysql_num_rows($result) > 0) {
+ if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
while ($tmp = PMA_mysql_fetch_array($result)) {
if (isset($tmp['Variable_name'])) {
switch ($tmp['Variable_name']) {
diff --git a/tbl_properties_operations.php b/tbl_properties_operations.php
index a22128d693..a61cd7f00d 100644
--- a/tbl_properties_operations.php
+++ b/tbl_properties_operations.php
@@ -371,7 +371,7 @@ if ($cfgRelation['relwork'] && $tbl_type != "INNODB") {
// modify robbat2 code - staybyte - 11. June 2001
$query = 'SHOW VARIABLES LIKE \'have_%\'';
$result = PMA_mysql_query($query);
- if ($result != FALSE && mysql_num_rows($result) > 0) {
+ if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
while ($tmp = PMA_mysql_fetch_array($result)) {
if (isset($tmp['Variable_name'])) {
switch ($tmp['Variable_name']) {
diff --git a/tbl_properties_structure.php b/tbl_properties_structure.php
index 7236458e57..0233740cbe 100644
--- a/tbl_properties_structure.php
+++ b/tbl_properties_structure.php
@@ -64,7 +64,7 @@ mysql_free_result($result);
// 3. Get fields
$local_query = 'SHOW FULL FIELDS FROM ' . PMA_backquote($table);
$fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
-$fields_cnt = mysql_num_rows($fields_rs);
+$fields_cnt = PMA_DBI_num_rows($fields_rs);
diff --git a/tbl_relation.php b/tbl_relation.php
index 9c1bd48c14..02c6a58529 100644
--- a/tbl_relation.php
+++ b/tbl_relation.php
@@ -277,7 +277,7 @@ if ($cfgRelation['relwork']) {
if (($curr_table[0] != $table) && ($curr_table[0] != $cfg['Server']['relation'])) {
$fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[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) {
+ if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {
$seen_a_primary=FALSE;
while ($curr_field = PMA_mysql_fetch_array($fi_rs)) {
if (isset($curr_field['Key_name']) && $curr_field['Key_name'] == 'PRIMARY') {
@@ -314,7 +314,7 @@ if ($cfgRelation['relwork']) {
} // end if
} // end while over keys
- } // end if (mysql_num_rows)
+ } // end if (PMA_DBI_num_rows)
// Mike Beck - 24.07.02: i've been asked to add all keys of the
// current table (see bug report #574851)
@@ -322,7 +322,7 @@ if ($cfgRelation['relwork']) {
else if ($curr_table[0] == $table) {
$fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[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) {
+ if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {
while ($curr_field = PMA_mysql_fetch_array($fi_rs)) {
$field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
$field_v = $curr_field['Table'] . '->' . $curr_field['Column_name'];
@@ -331,7 +331,7 @@ if ($cfgRelation['relwork']) {
$selectboxall_innodb[$field_full] = $field_v;
}
} // end while
- } // end if (mysql_num_rows)
+ } // end if (PMA_DBI_num_rows)
}
} // end while over tables
@@ -342,7 +342,7 @@ if ($cfgRelation['relwork']) {
$col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table);
$col_rs = PMA_mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0);
-if ($col_rs && mysql_num_rows($col_rs) > 0) {
+if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
while ($row = PMA_mysql_fetch_array($col_rs)) {
$save_row[] = $row;
}
diff --git a/tbl_select.php b/tbl_select.php
index 320b65ea2a..90d552fdfb 100644
--- a/tbl_select.php
+++ b/tbl_select.php
@@ -61,7 +61,7 @@ if (!isset($param) || $param[0] == '') {
PMA_mysqlDie('', $local_query, '', $err_url);
}
else {
- $fields_cnt = mysql_num_rows($result);
+ $fields_cnt = PMA_DBI_num_rows($result);
while ($row = PMA_mysql_fetch_array($result)) {
$fields_list[] = $row['Field'];
$type = $row['Type'];