db_multi_table_query.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Handles database multi-table querying
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. use PhpMyAdmin\Database\MultiTableQuery;
  9. use PhpMyAdmin\Response;
  10. require_once 'libraries/common.inc.php';
  11. if (isset($_POST['sql_query'])) {
  12. MultiTableQuery::displayResults(
  13. $_POST['sql_query'],
  14. $_REQUEST['db'],
  15. $pmaThemeImage
  16. );
  17. } if (isset($_GET['tables'])) {
  18. $constrains = $GLOBALS['dbi']->getForeignKeyConstrains(
  19. $_REQUEST['db'],
  20. $_GET['tables']
  21. );
  22. $response = Response::getInstance();
  23. $response->addJSON('foreignKeyConstrains',$constrains);
  24. } else {
  25. $response = Response::getInstance();
  26. $header = $response->getHeader();
  27. $scripts = $header->getScripts();
  28. $scripts->addFile('vendor/jquery/jquery.md5.js');
  29. $scripts->addFile('db_multi_table_query.js');
  30. $scripts->addFile('db_query_generator.js');
  31. $queryInstance = new MultiTableQuery($GLOBALS['dbi'], $db);
  32. $response->addHTML($queryInstance->getFormHtml());
  33. }