Rudimentary script in place for retreiving SQL query results by ajax,
and paginating the results table in place.
This commit is contained in:
33
js/sql.js
33
js/sql.js
@@ -5,14 +5,31 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$("#sqlqueryform").live('submit', function(event) {
|
$(document).ready(function() {
|
||||||
event.preventDefault();
|
|
||||||
|
//SQL Query Submit
|
||||||
|
$("#sqlqueryform").live('submit', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
PMA_ajaxShowMessage();
|
PMA_ajaxShowMessage();
|
||||||
|
|
||||||
$(this).append('<input type="hidden" name="ajax_request" value="true" />');
|
$(this).append('<input type="hidden" name="ajax_request" value="true" />');
|
||||||
|
|
||||||
$.post($(this).attr('action'), $(this).serialize() , function(data) {
|
$.post($(this).attr('action'), $(this).serialize() , function(data) {
|
||||||
$("#sqlqueryresults").html(data);
|
$("#sqlqueryresults").html(data);
|
||||||
})
|
})
|
||||||
})
|
}) // end SQL Query submit
|
||||||
|
|
||||||
|
//Paginate the results table
|
||||||
|
$("input[name=navig]").live('click', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var the_form = $(this).parent("form");
|
||||||
|
|
||||||
|
$(the_form).append('<input type="hidden" name="ajax_request" value="true" />');
|
||||||
|
|
||||||
|
$.post($(the_form).attr('action'), $(the_form).serialize(), function(data) {
|
||||||
|
$("#sqlqueryresults").html(data);
|
||||||
|
})
|
||||||
|
})// end Paginate results table
|
||||||
|
})
|
5
sql.php
5
sql.php
@@ -532,6 +532,11 @@ if (0 == $num_rows || $is_affected) {
|
|||||||
$goto = PMA_securePath($goto);
|
$goto = PMA_securePath($goto);
|
||||||
// Checks for a valid target script
|
// Checks for a valid target script
|
||||||
$is_db = $is_table = false;
|
$is_db = $is_table = false;
|
||||||
|
|
||||||
|
if( $GLOBALS['is_ajax_request'] == true) {
|
||||||
|
PMA_ajaxResponse($message);
|
||||||
|
}
|
||||||
|
|
||||||
include 'libraries/db_table_exists.lib.php';
|
include 'libraries/db_table_exists.lib.php';
|
||||||
if (strpos($goto, 'tbl_') === 0 && ! $is_table) {
|
if (strpos($goto, 'tbl_') === 0 && ! $is_table) {
|
||||||
if (strlen($table)) {
|
if (strlen($table)) {
|
||||||
|
Reference in New Issue
Block a user