db_sql.php 952 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Database SQL executor
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. use PhpMyAdmin\Config\PageSettings;
  9. use PhpMyAdmin\Response;
  10. use PhpMyAdmin\SqlQueryForm;
  11. /**
  12. *
  13. */
  14. require_once 'libraries/common.inc.php';
  15. PageSettings::showGroup('Sql');
  16. /**
  17. * Runs common work
  18. */
  19. $response = Response::getInstance();
  20. $header = $response->getHeader();
  21. $scripts = $header->getScripts();
  22. $scripts->addFile('makegrid.js');
  23. $scripts->addFile('vendor/jquery/jquery.uitablefilter.js');
  24. $scripts->addFile('sql.js');
  25. require 'libraries/db_common.inc.php';
  26. // After a syntax error, we return to this script
  27. // with the typed query in the textarea.
  28. $goto = 'db_sql.php';
  29. $back = 'db_sql.php';
  30. /**
  31. * Query box, bookmark, insert data from textfile
  32. */
  33. $response->addHTML(
  34. SqlQueryForm::getHtml(
  35. true, false,
  36. isset($_POST['delimiter'])
  37. ? htmlspecialchars($_POST['delimiter'])
  38. : ';'
  39. )
  40. );