server-side processing gets stuck
server-side processing gets stuck
amey1309
Posts: 28Questions: 0Answers: 0
Hello,
Iam using xampp-win32-1.7.7-VC9 as a backend and dreamweaver cs3 as frontend.I am trying to run the sample server_side.html, but its not displaying the data from table "ajax". I have created the sample table ajax using data.sql file from examples_support.
The only changes I have made to the server_processing.php file is the server configuration. I have used the DataTable debug add-on,which you(allan) had uploaded on one of your post.I gives a error "jQuery not loaded on this page, so no DataTables :( "
My files Are as follows:
[quote]server_side.html [/quote]
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "../../media/css/demo_page.css";
@import "../../media/css/demo_table.css";
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
//"sAjaxSource": "scripts/server_processing.php"
"sAjaxSource": "../server_side/scripts/server_processing.php"
} );
} );
DataTables server-side processing example
Live example
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
Loading data from server
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
[/code]
[quote]server_processing.php [/quote]
[code]
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'ajax.engine', 'ajax.browser', 'ajax.platform', 'ajax.version', 'ajax.grade' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "ajax.id";
/* DB table to use */
$sTable = "ajax";
/* Database connection information */
$gaSql['user'] = "root";
$gaSql['password'] = "";
$gaSql['db'] = "test";
$gaSql['server'] = "localhost";
$gaSql['type'] = "mysql";
/* REMOVE THIS LINE (it just includes my SQL connection user/pass) */
//include( $_SERVER['DOCUMENT_ROOT']."/datatables/mysql.php" );
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* Local functions
*/
function fatal_error ( $sErrorMessage = '' )
{
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
die( $sErrorMessage );
}
/*
* MySQL connection
*/
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
{
fatal_error( 'Could not open connection to server' );
}
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
{
fatal_error( 'Could not select database ' );
}
/*
* Paging
*/
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = "LIMIT ".intval( $_GET['iDisplayStart'] ).", ".
intval( $_GET['iDisplayLength'] );
}
/*
* Ordering
*/
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
[/code]
Iam using xampp-win32-1.7.7-VC9 as a backend and dreamweaver cs3 as frontend.I am trying to run the sample server_side.html, but its not displaying the data from table "ajax". I have created the sample table ajax using data.sql file from examples_support.
The only changes I have made to the server_processing.php file is the server configuration. I have used the DataTable debug add-on,which you(allan) had uploaded on one of your post.I gives a error "jQuery not loaded on this page, so no DataTables :( "
My files Are as follows:
[quote]server_side.html [/quote]
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "../../media/css/demo_page.css";
@import "../../media/css/demo_table.css";
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
//"sAjaxSource": "scripts/server_processing.php"
"sAjaxSource": "../server_side/scripts/server_processing.php"
} );
} );
DataTables server-side processing example
Live example
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
Loading data from server
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
[/code]
[quote]server_processing.php [/quote]
[code]
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'ajax.engine', 'ajax.browser', 'ajax.platform', 'ajax.version', 'ajax.grade' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "ajax.id";
/* DB table to use */
$sTable = "ajax";
/* Database connection information */
$gaSql['user'] = "root";
$gaSql['password'] = "";
$gaSql['db'] = "test";
$gaSql['server'] = "localhost";
$gaSql['type'] = "mysql";
/* REMOVE THIS LINE (it just includes my SQL connection user/pass) */
//include( $_SERVER['DOCUMENT_ROOT']."/datatables/mysql.php" );
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* Local functions
*/
function fatal_error ( $sErrorMessage = '' )
{
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
die( $sErrorMessage );
}
/*
* MySQL connection
*/
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
{
fatal_error( 'Could not open connection to server' );
}
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
{
fatal_error( 'Could not select database ' );
}
/*
* Paging
*/
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = "LIMIT ".intval( $_GET['iDisplayStart'] ).", ".
intval( $_GET['iDisplayLength'] );
}
/*
* Ordering
*/
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
[/code]
This discussion has been closed.
Replies
Thanks
http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
Allan
its the same example file,which one gets in DataTable 1.9.1 package, only I made modifications in server config.
Well I had use the DataTables debugger,its gives out an error "jQuery not loaded on this page, so no DataTables :( ".... Hope this helps.
Am trying to make this work from last 1 week.
I have tried to find what the server responces with.May be this screenshot will help you to fing the error..
[IMG]http://i48.tinypic.com/211jqs7.jpg[/IMG]
The othe "PREVIEW" and "RESPONSE" tabs are empty
Allan
Thanks
What to I do Allan??
As JSONP is a solution to the Cross Domain Call,it should have worked.But that too is not working.
Datable looks to be a great tool.I am trying to get it work from weeks,am fed up now.Even the examples are not working.Do I have to do any settings in the server??
Forget about the "server-Side Processing" example, the ajax example also is not working.Here are the screenshot [IMG]http://i50.tinypic.com/2ns44l3.jpg[/IMG]
[IMG]http://i47.tinypic.com/rrqnht.jpg[/IMG]
May be you can Point Out some Mistake which am doing
P.S. I have not edited any files