server-side processing gets stuck

server-side processing gets stuck

amey1309amey1309 Posts: 28Questions: 0Answers: 0
edited March 2013 in Bug reports
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]

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Link to a test case please.
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    Sorry Allan I didn't get you.I am totally a newbie so you got to tell me in detail what exactly you want or where exactly Ill get that.

    Thanks
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    edited March 2013
    I need a link to the page you are working on. If you can't provide one, use the debugger.

    http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    edited March 2013
    Thats fine Allan,but hoe do I upload my sql file without which it want work.I am all confused.My code is not displaying the data itself.
    its the same example file,which one gets in DataTable 1.9.1 package, only I made modifications in server config.
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    I don't want the SQL, or the code. I just want the link to the page. http://something.com/whatever . Without that, I cannot help.
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    I am trying to implement the examples which we get within the DataTable 1.9.1, so no question of error in the code.Only problem with my code is the jquery is not getting loaded. Do you have methods to deal with that ?? I am using google chrome version " Version 25.0.1364.172 m".Please tell me the methods to deal with this jquery thing :(
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    I honestly cannot offer any help without a link to the page you are working on. As you can see here - http://datatables.net/examples/ - the examples all work. So there is something wrong on your server. Without a link, I have absolutely no idea what that is.
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    Uploading the code is of no use as it will be the same from examples.How can I give you link to the page ?? Its all remote..
    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.
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    edited March 2013
    Hello Allan,
    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
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    You are doing a cross domain request and your browser is rejecting that as a security risk. I'd suggest reading up about cross domain Ajax, particularly JSONP.

    Allan
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    edited March 2013
    Thanks a lot Allan, I will read about it. But in the mean while It would have been better if you could suggest some solution.(A simple and an efficient one). Btw am working on a remote server with all the files under the xampp/htdocs/ folder......

    Thanks
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Yes - don't make a cross domain Ajax request. Browser's specifically block that. I'm not sure what else I can suggest.
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    Even the JSONP(http://datatables.net/release-datatables/examples/server_side/jsonp.html example is not working on my PC :(

    What to I do Allan??
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    When I load that page, it works just fine for me. To be able to offer any help at all, I need to be able to reproduce the error.
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    edited March 2013
    That page works fine for me too, but remotely it doesn't work for me.
    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??
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    From your screenshot you are trying to load form file:/// . Use a web-server. It will make your life much easier. The demos will work immediately (although obviously the server-side processing ones need a database set up, since it is useless without a database: http://datatables.net/development/server-side/sql
  • amey1309amey1309 Posts: 28Questions: 0Answers: 0
    I tried it to run from a server but it doesn't work.I do have a sql database needed to make that example work.
    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
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    I'd truly honestly like to help - but I simply cannot without a way to reproduce the error myself. When I download the package it simply works for me. As far as I am aware you are making no mistake, but I'm obviously missing some information, so I don't know what is going wrong and quite simply cannot help without being able to reproduce the error.
This discussion has been closed.