2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * query by example the whole database
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/DBQbe.class.php';
14 $response = PMA_Response
::getInstance();
16 // Gets the relation settings
17 $cfgRelation = PMA_getRelationsParam();
20 * A query has been submitted -> (maybe) execute it
22 $message_to_display = false;
23 if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
24 if (! preg_match('@^SELECT@i', $sql_query)) {
25 $message_to_display = true;
34 require 'libraries/db_common.inc.php';
35 $url_query .= '&goto=db_qbe.php';
36 $url_params['goto'] = 'db_qbe.php';
37 require 'libraries/db_info.inc.php';
39 if ($message_to_display) {
40 PMA_Message
::error(__('You have to choose at least one column to display'))->display();
42 unset($message_to_display);
44 // create new qbe search instance
45 $db_qbe = new PMA_DBQbe($GLOBALS['db']);
48 * Displays the Query by example form
50 if ($cfgRelation['designerwork']) {
51 $url = 'pmd_general.php' . PMA_generate_common_url(
60 __('Switch to %svisual builder%s'),
61 '<a href="' . $url . '">',
67 $response->addHTML($db_qbe->getSelectionForm($cfgRelation));