3 * Common includes for the table level views
7 declare(strict_types
=1);
12 if (! defined('PHPMYADMIN')) {
16 global $db, $table, $db_is_system_schema, $url_query, $url_params, $cfg, $dbi;
19 Util
::checkParameters(['db', 'table']);
21 $db_is_system_schema = $dbi->isSystemSchema($db);
24 * Set parameters for links
27 $url_query = Url
::getCommon(['db' => $db, 'table' => $table]);
30 * Set parameters for links
33 $url_params['db'] = $db;
34 $url_params['table'] = $table;
37 * Defines the urls to return to in case of error in a sql statement
39 $err_url_0 = Util
::getScriptNameForOption(
40 $cfg['DefaultTabDatabase'],
43 $err_url_0 .= Url
::getCommon(['db' => $db], strpos($err_url_0, '?') === false ?
'?' : '&');
45 $err_url = Util
::getScriptNameForOption(
46 $cfg['DefaultTabTable'],
49 $err_url .= Url
::getCommon($url_params, strpos($err_url, '?') === false ?
'?' : '&');
52 * Ensures the database and the table exist (else move to the "parent" script)
53 * Skip test if we are exporting as we can't tell whether a table name is an alias (which would fail the test).
55 if (($_GET['route'] ??
$_POST['route'] ??
'') === '/table/export') {
56 require_once ROOT_PATH
. 'libraries/db_table_exists.inc.php';