本文整理汇总了PHP中PMA_storeTheQueryAsBookmark函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_storeTheQueryAsBookmark函数的具体用法?PHP PMA_storeTheQueryAsBookmark怎么用?PHP PMA_storeTheQueryAsBookmark使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_storeTheQueryAsBookmark函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_executeTheQuery
/**
* Function to handle all aspects relating to executing the query
*
* @param array $analyzed_sql_results analyzed sql results
* @param String $full_sql_query full sql query
* @param boolean $is_gotofile whether to go to a file
* @param String $db current database
* @param String $table current table
* @param boolean $find_real_end whether to find the real end
* @param String $sql_query_for_bookmark sql query to be stored as bookmark
* @param array $extra_data extra data
*
* @return mixed
*/
function PMA_executeTheQuery($analyzed_sql_results, $full_sql_query, $is_gotofile, $db, $table, $find_real_end, $sql_query_for_bookmark, $extra_data)
{
$response = PMA_Response::getInstance();
$response->getHeader()->getMenu()->setTable($table);
// Only if we ask to see the php code
if (isset($GLOBALS['show_as_php'])) {
$result = null;
$num_rows = 0;
$unlim_num_rows = 0;
} else {
// If we don't ask to see the php code
if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
$GLOBALS['dbi']->query('SET PROFILING=1;');
}
$result = PMA_executeQueryAndStoreResults($full_sql_query);
// Displays an error message if required and stop parsing the script
$error = $GLOBALS['dbi']->getError();
if ($error) {
PMA_handleQueryExecuteError($is_gotofile, $error, $full_sql_query);
}
// If there are no errors and bookmarklabel was given,
// store the query as a bookmark
if (!empty($_POST['bkm_label']) && !empty($sql_query_for_bookmark)) {
$cfgBookmark = PMA_Bookmark_getParams();
PMA_storeTheQueryAsBookmark($db, $cfgBookmark['user'], $sql_query_for_bookmark, $_POST['bkm_label'], isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null);
}
// end store bookmarks
// Gets the number of rows affected/returned
// (This must be done immediately after the query because
// mysql_affected_rows() reports about the last query done)
$num_rows = PMA_getNumberOfRowsAffectedOrChanged($analyzed_sql_results['is_affected'], $result, isset($num_rows) ? $num_rows : null);
// Grabs the profiling results
if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
$profiling_results = $GLOBALS['dbi']->fetchResult('SHOW PROFILE;');
}
$justBrowsing = PMA_isJustBrowsing($analyzed_sql_results, isset($find_real_end) ? $find_real_end : null);
$unlim_num_rows = PMA_countQueryResults($num_rows, $analyzed_sql_results['is_select'], $justBrowsing, $db, $table, $analyzed_sql_results['parsed_sql'], $analyzed_sql_results);
$extra_data = PMA_cleanupRelations(isset($db) ? $db : '', isset($table) ? $table : '', isset($_REQUEST['dropped_column']) ? $_REQUEST['dropped_column'] : null, isset($_REQUEST['purge']) ? $_REQUEST['purge'] : null, isset($extra_data) ? $extra_data : null);
// Update Indexes list.
if (isset($_REQUEST['index_change'])) {
$extra_data['indexes_list'] = PMA_Index::getView($table, $db);
}
}
return array($result, $num_rows, $unlim_num_rows, isset($profiling_results) ? $profiling_results : null, $extra_data);
}
示例2: array
if (!isset($ajax_reload)) {
$ajax_reload = array();
}
if (isset($table)) {
$ajax_reload['table_name'] = $table;
}
$response = PMA_Response::getInstance();
$response->addJSON('ajax_reload', $ajax_reload);
$response->addHTML($html_output);
exit;
} else {
if ($result) {
// Save a Bookmark with more than one queries (if Bookmark label given).
if (!empty($_POST['bkm_label']) && !empty($import_text)) {
$cfgBookmark = PMA_Bookmark_getParams();
PMA_storeTheQueryAsBookmark($db, $cfgBookmark['user'], $_REQUEST['sql_query'], $_POST['bkm_label'], isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null);
}
$response = PMA_Response::getInstance();
$response->isSuccess(true);
$response->addJSON('message', PMA_Message::success($msg));
$response->addJSON('sql_query', PMA_Util::getMessage($msg, $sql_query, 'success'));
} else {
if ($result == false) {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', PMA_Message::error($msg));
} else {
$active_page = $goto;
include '' . $goto;
}
}
示例3: PMA_executeQueryAndSendQueryResponse
PMA_Util::mysqlDie($die['error'], $die['sql'], false, $err_url, $error);
}
}
if ($go_sql) {
// parse sql query
include_once 'libraries/parse_analyze.inc.php';
if (isset($ajax_reload) && $ajax_reload['reload'] === true) {
$response = PMA_Response::getInstance();
$response->addJSON('ajax_reload', $ajax_reload);
}
PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, false, $db, $table, null, $import_text, null, $analyzed_sql_results['is_affected'], null, null, null, null, $goto, $pmaThemeImage, null, null, null, $sql_query, null, null);
} else {
if ($result) {
// Save a Bookmark with more than one queries (if Bookmark label given).
if (!empty($_POST['bkm_label']) && !empty($import_text)) {
PMA_storeTheQueryAsBookmark($db, $GLOBALS['cfg']['Bookmark']['user'], $import_text, $_POST['bkm_label'], isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null);
}
$response = PMA_Response::getInstance();
$response->isSuccess(true);
$response->addJSON('message', PMA_Message::success($msg));
$response->addJSON('sql_query', PMA_Util::getMessage($msg, $sql_query, 'success'));
} else {
if ($result == false) {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', PMA_Message::error($msg));
} else {
$active_page = $goto;
include '' . $goto;
}
}
示例4: PMA_executeQueryAndSendQueryResponse
if ($go_sql) {
// parse sql query
include_once 'libraries/parse_analyze.inc.php';
PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, false, $db, $table, null, $import_text, null, $analyzed_sql_results['is_affected'], null, null, null, $sql_data, $goto, $pmaThemeImage, null, null, null, $sql_query, null, null);
if (!isset($ajax_reload)) {
$ajax_reload = array();
}
$ajax_reload['table_name'] = $table;
$response = PMA_Response::getInstance();
$response->addJSON('ajax_reload', $ajax_reload);
} else {
if ($result) {
// Save a Bookmark with more than one queries (if Bookmark label given).
if (!empty($_POST['bkm_label']) && !empty($import_text)) {
$cfgBookmark = PMA_Bookmark_getParams();
PMA_storeTheQueryAsBookmark($db, $cfgBookmark['user'], $import_text, $_POST['bkm_label'], isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null);
}
$response = PMA_Response::getInstance();
$response->isSuccess(true);
$response->addJSON('message', PMA_Message::success($msg));
$response->addJSON('sql_query', PMA_Util::getMessage($msg, $sql_query, 'success'));
} else {
if ($result == false) {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', PMA_Message::error($msg));
} else {
$active_page = $goto;
include '' . $goto;
}
}