本文整理汇总了PHP中PMA_getQueryFromSelected函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getQueryFromSelected函数的具体用法?PHP PMA_getQueryFromSelected怎么用?PHP PMA_getQueryFromSelected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getQueryFromSelected函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
if (!empty($submit_mult) && !empty($what)) {
unset($message);
/** @var PMA_String $pmaString */
$pmaString = $GLOBALS['PMA_String'];
if (mb_strlen($table)) {
include './libraries/tbl_common.inc.php';
$url_query .= '&goto=tbl_sql.php&back=tbl_sql.php';
include './libraries/tbl_info.inc.php';
} elseif (mb_strlen($db)) {
include './libraries/db_common.inc.php';
include './libraries/db_info.inc.php';
} else {
include_once './libraries/server_common.inc.php';
}
// Builds the query
list($full_query, $reload, $full_query_views) = PMA_getQueryFromSelected($what, $db, $table, $selected, $views);
// Displays the confirmation form
$_url_params = PMA_getUrlParams($what, $reload, $action, $db, $table, $selected, $views, isset($original_sql_query) ? $original_sql_query : null, isset($original_url_query) ? $original_url_query : null);
$response = PMA_Response::getInstance();
if ($what == 'replace_prefix_tbl' || $what == 'copy_tbl_change_prefix') {
$response->addHTML(PMA_getHtmlForReplacePrefixTable($what, $action, $_url_params));
} elseif ($what == 'add_prefix_tbl') {
$response->addHTML(PMA_getHtmlForAddPrefixTable($action, $_url_params));
} else {
$response->addHTML(PMA_getHtmlForOtherActions($what, $action, $_url_params, $full_query));
}
exit;
} elseif (!empty($mult_btn) && $mult_btn == __('Yes')) {
/**
* Executes the query - dropping rows, columns/fields, tables or dbs
*/
示例2: testPMAGetQueryFromSelected
/**
* Test for PMA_getQueryFromSelected
*
* @return void
*/
public function testPMAGetQueryFromSelected()
{
$what = "drop_tbl";
$db = "PMA_db";
$table = "PMA_table";
$selected = array("table1", "table2");
$views = array("table1", "table2");
list($full_query, $reload, $full_query_views) = PMA_getQueryFromSelected($what, $db, $table, $selected, $views);
//validate 1: $full_query
$this->assertContains("DROP VIEW `table1`, `table2`", $full_query);
//validate 2: $reload
$this->assertEquals(false, $reload);
//validate 3: $full_query_views
$this->assertEquals(null, $full_query_views);
$what = "drop_db";
list($full_query, $reload, $full_query_views) = PMA_getQueryFromSelected($what, $db, $table, $selected, $views);
//validate 1: $full_query
$this->assertContains("DROP DATABASE `table1`;<br />DROP DATABASE `table2`;", $full_query);
//validate 2: $reload
$this->assertEquals(true, $reload);
}