avoid 'no database selected' errors in MySQL 5.0.2

This commit is contained in:
Marc Delisle
2005-02-14 13:42:15 +00:00
parent 812c3122d5
commit 0b1d932f3e
2 changed files with 9 additions and 0 deletions

View File

@@ -21,6 +21,11 @@ global $showtable, $tbl_is_view, $tbl_type, $show_comment, $tbl_collation,
/**
* Gets table informations
*/
// Seems we need to do this in MySQL 5.0.2,
// otherwise error #1046, no database selected
PMA_DBI_select_db($db);
// The 'show table' statement works correct since 3.23.03
$table_info_result = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';');
$showtable = PMA_DBI_fetch_assoc($table_info_result);