PMA_DBI_num_rows
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$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>
|
2004-01-19 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/common.lib.php, libraries/dbi/mysql.dbi.lib.php:
|
* libraries/common.lib.php, libraries/dbi/mysql.dbi.lib.php:
|
||||||
PMA_DBI_get_dblist()
|
PMA_DBI_get_dblist()
|
||||||
|
@@ -135,8 +135,7 @@ while ($row = mysql_fetch_array($rowset)) {
|
|||||||
*/
|
*/
|
||||||
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
|
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
|
||||||
$result = PMA_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);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
|
|
||||||
// Check if we can use Relations (Mike Beck)
|
// Check if we can use Relations (Mike Beck)
|
||||||
if (!empty($cfgRelation['relation'])) {
|
if (!empty($cfgRelation['relation'])) {
|
||||||
// Find which tables are related with the current one and write it in
|
// Find which tables are related with the current one and write it in
|
||||||
|
@@ -21,7 +21,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
|
|||||||
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
|
$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);
|
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
||||||
// Blending out tables in use
|
// 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)) {
|
while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
|
||||||
// if in use memorize tablename
|
// if in use memorize tablename
|
||||||
if (preg_match('@in_use=[1-9]+@i', $tmp[1])) {
|
if (preg_match('@in_use=[1-9]+@i', $tmp[1])) {
|
||||||
@@ -33,7 +33,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
|
|||||||
if (isset($sot_cache)) {
|
if (isset($sot_cache)) {
|
||||||
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
||||||
$db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
|
$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)) {
|
while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
|
||||||
if (!isset($sot_cache[$tmp[0]])) {
|
if (!isset($sot_cache[$tmp[0]])) {
|
||||||
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($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)) {
|
if (!isset($sot_ready)) {
|
||||||
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
|
$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);
|
$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)) {
|
while ($sts_tmp = PMA_mysql_fetch_array($db_info_result)) {
|
||||||
$tables[] = $sts_tmp;
|
$tables[] = $sts_tmp;
|
||||||
}
|
}
|
||||||
|
@@ -115,7 +115,7 @@ if ($row < 0) {
|
|||||||
* Prepares the form
|
* Prepares the form
|
||||||
*/
|
*/
|
||||||
$tbl_result = PMA_mysql_list_tables($db);
|
$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;
|
$i = 0;
|
||||||
$k = 0;
|
$k = 0;
|
||||||
|
|
||||||
|
@@ -650,7 +650,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) {
|
|||||||
$test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
|
$test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
||||||
$test_rs = PMA_query_as_cu($test_query);
|
$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";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
|
@@ -35,7 +35,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
|
|||||||
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
|
$local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
|
||||||
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
||||||
// Blending out tables in use
|
// 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)) {
|
while ($tmp = PMA_mysql_fetch_array($result)) {
|
||||||
// if in use memorize tablename
|
// if in use memorize tablename
|
||||||
if (preg_match('@in_use=[1-9]+@i', $tmp[0])) {
|
if (preg_match('@in_use=[1-9]+@i', $tmp[0])) {
|
||||||
@@ -47,7 +47,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
|
|||||||
if (isset($sot_cache)) {
|
if (isset($sot_cache)) {
|
||||||
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
$local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
|
||||||
$result = PMA_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) {
|
if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
|
||||||
while ($tmp = PMA_mysql_fetch_array($result)) {
|
while ($tmp = PMA_mysql_fetch_array($result)) {
|
||||||
if (!isset($sot_cache[$tmp[0]])) {
|
if (!isset($sot_cache[$tmp[0]])) {
|
||||||
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($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)) {
|
if (!isset($sot_ready)) {
|
||||||
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
|
$local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
|
||||||
$result = PMA_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) {
|
if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
|
||||||
while ($sts_tmp = PMA_mysql_fetch_array($result)) {
|
while ($sts_tmp = PMA_mysql_fetch_array($result)) {
|
||||||
$tables[] = $sts_tmp;
|
$tables[] = $sts_tmp;
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ $url_query .= '&goto=db_search.php';
|
|||||||
* Get the list of tables from the current database
|
* Get the list of tables from the current database
|
||||||
*/
|
*/
|
||||||
$list_tables = PMA_mysql_list_tables($db);
|
$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++) {
|
for ($i = 0; $i < $num_tables; $i++) {
|
||||||
$tables[] = PMA_mysql_tablename($list_tables, $i);
|
$tables[] = PMA_mysql_tablename($list_tables, $i);
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ if (isset($submit_search)) {
|
|||||||
// Fields to select
|
// Fields to select
|
||||||
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']);
|
$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 = @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++) {
|
for ($i = 0; $i < $res_cnt; $i++) {
|
||||||
$tblfields[] = PMA_backquote(PMA_mysql_result($res, $i, 'field'));
|
$tblfields[] = PMA_backquote(PMA_mysql_result($res, $i, 'field'));
|
||||||
} // end if
|
} // end if
|
||||||
|
@@ -154,7 +154,7 @@ if (PMA_MYSQL_INT_VERSION < 32349) {
|
|||||||
if (PMA_MYSQL_INT_VERSION > 40003) {
|
if (PMA_MYSQL_INT_VERSION > 40003) {
|
||||||
$tmp_query = "SHOW VARIABLES LIKE 'local\\_infile'";
|
$tmp_query = "SHOW VARIABLES LIKE 'local\\_infile'";
|
||||||
$result = PMA_mysql_query($tmp_query);
|
$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);
|
$tmp = PMA_mysql_fetch_row($result);
|
||||||
if ($tmp[1] == 'ON') {
|
if ($tmp[1] == 'ON') {
|
||||||
$local_option_selected = TRUE;
|
$local_option_selected = TRUE;
|
||||||
|
@@ -58,7 +58,7 @@ function PMA_listBookmarks($db, $cfgBookmark)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// There is some bookmarks -> store them
|
// 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;
|
$flag = 1;
|
||||||
while ($row = PMA_mysql_fetch_row($result)) {
|
while ($row = PMA_mysql_fetch_row($result)) {
|
||||||
$bookmark_list[$flag . ' - ' . $row[0]] = $row[1];
|
$bookmark_list[$flag . ' - ' . $row[0]] = $row[1];
|
||||||
|
@@ -487,7 +487,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|||||||
// grab indexes data:
|
// grab indexes data:
|
||||||
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
|
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
|
||||||
$result = PMA_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);
|
$idx_cnt = PMA_DBI_num_rows($result);
|
||||||
|
|
||||||
$prev_index = '';
|
$prev_index = '';
|
||||||
for ($i = 0; $i < $idx_cnt; $i++) {
|
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])
|
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
|
||||||
. ' = ' . $row[$pointer];
|
. ' = ' . $row[$pointer];
|
||||||
$dispresult = PMA_mysql_query($dispsql);
|
$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);
|
$dispval = PMA_mysql_result($dispresult, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1428,7 +1428,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
|
|||||||
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
|
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
|
||||||
. ' = \'' . PMA_sqlAddslashes($row[$pointer]) . '\'';
|
. ' = \'' . PMA_sqlAddslashes($row[$pointer]) . '\'';
|
||||||
$dispresult = @PMA_mysql_query($dispsql);
|
$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);
|
$dispval = PMA_mysql_result($dispresult, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -215,7 +215,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
PMA_mysql_select_db($db);
|
PMA_mysql_select_db($db);
|
||||||
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
|
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
|
||||||
$result = PMA_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_rows($result);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
|
|
||||||
// Check if we can use Relations (Mike Beck)
|
// Check if we can use Relations (Mike Beck)
|
||||||
if ($do_relation && !empty($cfgRelation['relation'])) {
|
if ($do_relation && !empty($cfgRelation['relation'])) {
|
||||||
|
@@ -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) . '\'');
|
$result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table) . '\'');
|
||||||
if ($result != FALSE) {
|
if ($result != FALSE) {
|
||||||
if (mysql_num_rows($result) > 0) {
|
if (PMA_DBI_num_rows($result) > 0) {
|
||||||
$tmpres = PMA_mysql_fetch_array($result);
|
$tmpres = PMA_mysql_fetch_array($result);
|
||||||
if (isset($GLOBALS['auto_increment']) && !empty($tmpres['Auto_increment'])) {
|
if (isset($GLOBALS['auto_increment']) && !empty($tmpres['Auto_increment'])) {
|
||||||
$auto_increment .= ' AUTO_INCREMENT=' . $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');
|
PMA_mysql_query('SET SQL_QUOTE_SHOW_CREATE = 0');
|
||||||
}
|
}
|
||||||
$result = PMA_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) {
|
if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
|
||||||
$tmpres = PMA_mysql_fetch_array($result);
|
$tmpres = PMA_mysql_fetch_array($result);
|
||||||
// Fix for case problems with winwin, thanks to
|
// Fix for case problems with winwin, thanks to
|
||||||
// Pawe<77> Szczepa<70>ski <pauluz at users.sourceforge.net>
|
// Pawe<77> Szczepa<70>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);
|
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $error_url);
|
||||||
if ($result != FALSE) {
|
if ($result != FALSE) {
|
||||||
$fields_cnt = mysql_num_fields($result);
|
$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)
|
// get the real types of the table's fields (in an array)
|
||||||
// the key of the array is the backquoted field name
|
// the key of the array is the backquoted field name
|
||||||
|
@@ -470,7 +470,7 @@ function PMA_setComment($db, $table, $key, $value, $removekey = '') {
|
|||||||
. ' AND column_name = \'' . PMA_sqlAddslashes($key) . '\'';
|
. ' AND column_name = \'' . PMA_sqlAddslashes($key) . '\'';
|
||||||
$test_rs = PMA_query_as_cu($test_qry);
|
$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);
|
$row = @PMA_mysql_fetch_array($test_rs);
|
||||||
|
|
||||||
if (strlen($value) > 0 || strlen($row['mimetype']) > 0 || strlen($row['transformation']) > 0 || strlen($row['transformation_options']) > 0) {
|
if (strlen($value) > 0 || strlen($row['mimetype']) > 0 || strlen($row['transformation']) > 0 || strlen($row['transformation_options']) > 0) {
|
||||||
|
@@ -136,7 +136,7 @@ function PMA_setMIME($db, $table, $key, $mimetype, $transformation, $transformat
|
|||||||
. ' AND column_name = \'' . PMA_sqlAddslashes($key) . '\'';
|
. ' AND column_name = \'' . PMA_sqlAddslashes($key) . '\'';
|
||||||
$test_rs = PMA_query_as_cu($test_qry);
|
$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);
|
$row = @PMA_mysql_fetch_array($test_rs);
|
||||||
|
|
||||||
if (!$forcedelete && (strlen($mimetype) > 0 || strlen($transformation) > 0 || strlen($transformation_options) > 0 || strlen($row['comment']) > 0)) {
|
if (!$forcedelete && (strlen($mimetype) > 0 || strlen($transformation) > 0 || strlen($transformation_options) > 0 || strlen($row['comment']) > 0)) {
|
||||||
|
@@ -91,7 +91,7 @@ if ($cfgRelation['pdfwork']) {
|
|||||||
. ' GROUP BY master_table'
|
. ' GROUP BY master_table'
|
||||||
. ' ORDER BY ' . PMA_backquote('COUNT(master_table)') . ' DESC ';
|
. ' ORDER BY ' . PMA_backquote('COUNT(master_table)') . ' DESC ';
|
||||||
$master_tables_rs = PMA_query_as_cu($master_tables);
|
$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
|
// first put all the master tables at beginning
|
||||||
// of the list, so they are near the center of
|
// of the list, so they are near the center of
|
||||||
// the schema
|
// the schema
|
||||||
@@ -185,7 +185,7 @@ if ($cfgRelation['pdfwork']) {
|
|||||||
. ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
|
. ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
|
||||||
. ' AND pdf_page_number = ' . $chpage;
|
. ' AND pdf_page_number = ' . $chpage;
|
||||||
$test_rs = PMA_query_as_cu($test_query);
|
$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') {
|
if (isset($arrvalue['delete']) && $arrvalue['delete'] == 'y') {
|
||||||
$ch_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords'])
|
$ch_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords'])
|
||||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||||
@@ -232,7 +232,7 @@ if ($cfgRelation['pdfwork']) {
|
|||||||
$page_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
|
$page_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
||||||
$page_rs = PMA_query_as_cu($page_query);
|
$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">
|
<form method="get" action="pdf_pages.php" name="selpage">
|
||||||
<?php echo $strChoosePage . "\n"; ?>
|
<?php echo $strChoosePage . "\n"; ?>
|
||||||
@@ -323,7 +323,7 @@ foreach($array_sh_page AS $key => $temp_sh_page) {
|
|||||||
. PMA_backquote($temp_sh_page['table_name'] )
|
. PMA_backquote($temp_sh_page['table_name'] )
|
||||||
. ' FROM ' . PMA_backquote($db);
|
. ' FROM ' . PMA_backquote($db);
|
||||||
$fields_rs = PMA_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_cnt = PMA_DBI_num_rows($fields_rs);
|
||||||
|
|
||||||
echo '<div id="table_' . $i . '" class="pdflayout_table"><u>' . $temp_sh_page['table_name'] . '</u>';
|
echo '<div id="table_' . $i . '" class="pdflayout_table"><u>' . $temp_sh_page['table_name'] . '</u>';
|
||||||
while ($row = PMA_mysql_fetch_array($fields_rs)) {
|
while ($row = PMA_mysql_fetch_array($fields_rs)) {
|
||||||
|
@@ -684,7 +684,7 @@ class PMA_RT_Table
|
|||||||
$this->table_name = $table_name;
|
$this->table_name = $table_name;
|
||||||
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
|
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
|
||||||
$result = PMA_mysql_query($sql);
|
$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));
|
$pdf->PMA_PDF_die(sprintf($GLOBALS['strPdfInvalidTblName'], $table_name));
|
||||||
}
|
}
|
||||||
// load fields
|
// load fields
|
||||||
@@ -707,7 +707,7 @@ class PMA_RT_Table
|
|||||||
. ' AND pdf_page_number = ' . $pdf_page_number;
|
. ' AND pdf_page_number = ' . $pdf_page_number;
|
||||||
$result = PMA_query_as_cu($sql);
|
$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));
|
$pdf->PMA_PDF_die(sprintf($GLOBALS['strConfigureTableCoord'], $table_name));
|
||||||
}
|
}
|
||||||
list($this->x, $this->y) = PMA_mysql_fetch_array($result);
|
list($this->x, $this->y) = PMA_mysql_fetch_array($result);
|
||||||
@@ -719,7 +719,7 @@ class PMA_RT_Table
|
|||||||
// index
|
// index
|
||||||
$sql = 'SHOW index FROM ' . PMA_backquote($table_name);
|
$sql = 'SHOW index FROM ' . PMA_backquote($table_name);
|
||||||
$result = PMA_mysql_query($sql);
|
$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)) {
|
while ($row = PMA_mysql_fetch_array($result)) {
|
||||||
if ($row['Key_name'] == 'PRIMARY') {
|
if ($row['Key_name'] == 'PRIMARY') {
|
||||||
$this->primary[] = $row['Column_name'];
|
$this->primary[] = $row['Column_name'];
|
||||||
@@ -1108,7 +1108,7 @@ class PMA_RT
|
|||||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||||
. ' AND pdf_page_number = ' . $which_rel;
|
. ' AND pdf_page_number = ' . $which_rel;
|
||||||
$tab_rs = PMA_query_as_cu($tab_sql);
|
$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']);
|
$pdf->PMA_PDF_die($GLOBALS['strPdfNoTables']);
|
||||||
// die('No tables');
|
// die('No tables');
|
||||||
}
|
}
|
||||||
@@ -1198,7 +1198,7 @@ class PMA_RT
|
|||||||
|
|
||||||
// loic1: also show tables without relations
|
// loic1: also show tables without relations
|
||||||
// $norelations = TRUE;
|
// $norelations = TRUE;
|
||||||
// if ($result && mysql_num_rows($result) > 0) {
|
// if ($result && PMA_DBI_num_rows($result) > 0) {
|
||||||
// $norelations = FALSE;
|
// $norelations = FALSE;
|
||||||
// while ($row = PMA_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']);
|
// $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);
|
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
|
||||||
$result = PMA_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);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
|
|
||||||
|
|
||||||
// Check if we can use Relations (Mike Beck)
|
// Check if we can use Relations (Mike Beck)
|
||||||
|
@@ -277,7 +277,7 @@ if ($sql_query != '') {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if ($cfg['VerboseMultiSubmit']) {
|
} 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();
|
$a_aff_rows = (int)@mysql_affected_rows();
|
||||||
if ($a_num_rows > 0) {
|
if ($a_num_rows > 0) {
|
||||||
$a_rows = $a_num_rows;
|
$a_rows = $a_num_rows;
|
||||||
|
4
sql.php
4
sql.php
@@ -336,7 +336,7 @@ else {
|
|||||||
// mysql_affected_rows() reports about the last query done)
|
// mysql_affected_rows() reports about the last query done)
|
||||||
|
|
||||||
if (!$is_affected) {
|
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)) {
|
} else if (!isset($num_rows)) {
|
||||||
$num_rows = @mysql_affected_rows();
|
$num_rows = @mysql_affected_rows();
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@ else {
|
|||||||
if (PMA_MYSQL_INT_VERSION < 40000) {
|
if (PMA_MYSQL_INT_VERSION < 40000) {
|
||||||
if ($cnt_all_result = PMA_mysql_query($count_query)) {
|
if ($cnt_all_result = PMA_mysql_query($count_query)) {
|
||||||
if ($is_group && $count_what == '*') {
|
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 {
|
} else {
|
||||||
$unlim_num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
|
$unlim_num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
|
||||||
}
|
}
|
||||||
|
@@ -193,7 +193,7 @@ if ($cfg['PropertiesIconic'] == true) {
|
|||||||
|
|
||||||
// Set if we passed the first timestamp field
|
// Set if we passed the first timestamp field
|
||||||
$timestamp_seen = 0;
|
$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
|
// Set a flag here because the 'if' would not be valid in the loop
|
||||||
// if we set a value in some field
|
// if we set a value in some field
|
||||||
|
@@ -71,7 +71,7 @@ if (defined('PMA_IDX_INCLUDED')) {
|
|||||||
} else {
|
} else {
|
||||||
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
|
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
|
||||||
$result = PMA_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);
|
$idx_cnt = PMA_DBI_num_rows($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = 0; $i < $idx_cnt; $i++) {
|
for ($i = 0; $i < $idx_cnt; $i++) {
|
||||||
@@ -114,7 +114,7 @@ if (defined('PMA_IDX_INCLUDED')) {
|
|||||||
} else {
|
} else {
|
||||||
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
|
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
|
||||||
$fields_rs = PMA_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_cnt = PMA_DBI_num_rows($fields_rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields_names = array();
|
$fields_names = array();
|
||||||
|
@@ -137,7 +137,7 @@ foreach($the_tables AS $key => $table) {
|
|||||||
*/
|
*/
|
||||||
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
|
$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
|
||||||
$result = PMA_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);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
|
|
||||||
// Check if we can use Relations (Mike Beck)
|
// Check if we can use Relations (Mike Beck)
|
||||||
if (!empty($cfgRelation['relation'])) {
|
if (!empty($cfgRelation['relation'])) {
|
||||||
|
@@ -560,7 +560,7 @@ if ($action == 'tbl_create.php') {
|
|||||||
// find mysql capability - staybyte - 11. June 2001
|
// find mysql capability - staybyte - 11. June 2001
|
||||||
$query = 'SHOW VARIABLES LIKE \'have_%\'';
|
$query = 'SHOW VARIABLES LIKE \'have_%\'';
|
||||||
$result = PMA_mysql_query($query);
|
$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)) {
|
while ($tmp = PMA_mysql_fetch_array($result)) {
|
||||||
if (isset($tmp['Variable_name'])) {
|
if (isset($tmp['Variable_name'])) {
|
||||||
switch ($tmp['Variable_name']) {
|
switch ($tmp['Variable_name']) {
|
||||||
|
@@ -371,7 +371,7 @@ if ($cfgRelation['relwork'] && $tbl_type != "INNODB") {
|
|||||||
// modify robbat2 code - staybyte - 11. June 2001
|
// modify robbat2 code - staybyte - 11. June 2001
|
||||||
$query = 'SHOW VARIABLES LIKE \'have_%\'';
|
$query = 'SHOW VARIABLES LIKE \'have_%\'';
|
||||||
$result = PMA_mysql_query($query);
|
$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)) {
|
while ($tmp = PMA_mysql_fetch_array($result)) {
|
||||||
if (isset($tmp['Variable_name'])) {
|
if (isset($tmp['Variable_name'])) {
|
||||||
switch ($tmp['Variable_name']) {
|
switch ($tmp['Variable_name']) {
|
||||||
|
@@ -64,7 +64,7 @@ mysql_free_result($result);
|
|||||||
// 3. Get fields
|
// 3. Get fields
|
||||||
$local_query = 'SHOW FULL FIELDS FROM ' . PMA_backquote($table);
|
$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_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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -277,7 +277,7 @@ if ($cfgRelation['relwork']) {
|
|||||||
if (($curr_table[0] != $table) && ($curr_table[0] != $cfg['Server']['relation'])) {
|
if (($curr_table[0] != $table) && ($curr_table[0] != $cfg['Server']['relation'])) {
|
||||||
$fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[0]);
|
$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);
|
$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;
|
$seen_a_primary=FALSE;
|
||||||
while ($curr_field = PMA_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') {
|
if (isset($curr_field['Key_name']) && $curr_field['Key_name'] == 'PRIMARY') {
|
||||||
@@ -314,7 +314,7 @@ if ($cfgRelation['relwork']) {
|
|||||||
|
|
||||||
} // end if
|
} // end if
|
||||||
} // end while over keys
|
} // 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
|
// Mike Beck - 24.07.02: i've been asked to add all keys of the
|
||||||
// current table (see bug report #574851)
|
// current table (see bug report #574851)
|
||||||
@@ -322,7 +322,7 @@ if ($cfgRelation['relwork']) {
|
|||||||
else if ($curr_table[0] == $table) {
|
else if ($curr_table[0] == $table) {
|
||||||
$fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[0]);
|
$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);
|
$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)) {
|
while ($curr_field = PMA_mysql_fetch_array($fi_rs)) {
|
||||||
$field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
|
$field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
|
||||||
$field_v = $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;
|
$selectboxall_innodb[$field_full] = $field_v;
|
||||||
}
|
}
|
||||||
} // end while
|
} // end while
|
||||||
} // end if (mysql_num_rows)
|
} // end if (PMA_DBI_num_rows)
|
||||||
}
|
}
|
||||||
} // end while over tables
|
} // end while over tables
|
||||||
|
|
||||||
@@ -342,7 +342,7 @@ if ($cfgRelation['relwork']) {
|
|||||||
$col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table);
|
$col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table);
|
||||||
$col_rs = PMA_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) {
|
if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
|
||||||
while ($row = PMA_mysql_fetch_array($col_rs)) {
|
while ($row = PMA_mysql_fetch_array($col_rs)) {
|
||||||
$save_row[] = $row;
|
$save_row[] = $row;
|
||||||
}
|
}
|
||||||
|
@@ -61,7 +61,7 @@ if (!isset($param) || $param[0] == '') {
|
|||||||
PMA_mysqlDie('', $local_query, '', $err_url);
|
PMA_mysqlDie('', $local_query, '', $err_url);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$fields_cnt = mysql_num_rows($result);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
while ($row = PMA_mysql_fetch_array($result)) {
|
while ($row = PMA_mysql_fetch_array($result)) {
|
||||||
$fields_list[] = $row['Field'];
|
$fields_list[] = $row['Field'];
|
||||||
$type = $row['Type'];
|
$type = $row['Type'];
|
||||||
|
Reference in New Issue
Block a user