Server-side Processing HELP!

Server-side Processing HELP!

nytram6nytram6 Posts: 8Questions: 4Answers: 0

I am hoping someone can help!

I have been through the server-side processing example 100 times and I cannot get it to work!

A little bit of background on what I am trying to achieve:

I have created a datatable with a client side html table, but due to the large amount of data table loading is incredibly slow (https://www.airlinecomponents.com/products).

To rectify this I would like to migrate the table data to mysql and pull the information from there.
I have created a page (index.html) and also the necessary server-processing.php and hosted them on http://www.aciltd.com/test/.

However, I am constantly getting the following error message:
"DataTables warning: table id=example - Ajax error. For more information about this error, please see http://datatables.net/tn/7".

Where could the error be? Is it with the index or php file?

Can somebody therefore please let me know what I am doing wrong.

I am not a web designer and what I have learnt to date has simply been through tutorials (it is incredible that I have got this far!).

I have also attached the associated files (with mysql login details removed).

Help would be greatly appreciated.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    The server is responding with 404 to:

    http://www.aciltd.com/test/scripts/server_processing.php? ....

    That suggests that there is no such script at that address. Indeed, loading it directly in the browser confirms that.

    Allan

  • gyrocodegyrocode Posts: 126Questions: 6Answers: 30
    edited June 2017

    It looks like you put the script server_processing.php in /test folder but use incorrect path in the following option "ajax": "scripts/server_processing.php".

    • Correct path in ajax option, probably it should be "ajax": "server_processing.php" or move the script server_processing.php to scripts sub-folder.

    • Make sure that database credentials are correct in server_processing.php.

    • Make sure that there is ssp.class.php file in the same folder as server_processing.php


    See more articles about jQuery DataTables on gyrocode.com.

  • nytram6nytram6 Posts: 8Questions: 4Answers: 0

    Thank you both for your prompt replies - it is greatly appreciated.
    Apologies for the confusion, I did have server_processing.php in a scripts directory but moved it as I sent my message - not useful I appreciate.

    I now have both index.html & server_processing.php in the test directory.

    From your responses the only thing I am at a loss with is the ssp.class.php file - what content should be in this php file - there isn't any indication on the example page https://datatables.net/examples/server_side/simple.html.

    If you could provide an example ssp.class.php file that I could use that would be great.

    My database credentials appear to be correct - is it possible to check the server_processing.php in developer to test this?

    Thanks again.

  • gyrocodegyrocode Posts: 126Questions: 6Answers: 30
    Answer ✓

    File ssp.class.php is available in DataTables distribution and also can be downloaded from DataTables repository on GitHub, see this link.

    Once you download it, place this file along with server_processing.php script.


    See more articles about jQuery DataTables on gyrocode.com.

This discussion has been closed.