DataTables warning (table id = 'example'):

DataTables warning (table id = 'example'):

mattmillenmattmillen Posts: 10Questions: 0Answers: 0
edited November 2013 in DataTables 1.9
Hi There,

I have just downloaded datatables out and created a database using data.sql i run the test and get the message:

DataTables warning (table id = 'example'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.

this is the debugger code: iropet

it should work as i have just used your data and have not made any changes yet.

I am running zend server ce locally just so you know. but am not using any frameworks right now this is just a plain page as per your files

any ideas what the issue is?

Thing is if i can get your example working then ill be fine with any other version i would think

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi,

    Thanks for picking up the DataTables support option and also for providing the debug code!

    Looking at the information in the debugger, the server is replying with this:

    [quote]
    < br / > < b > Warning < /b>: include(/usr / local / zend / apache2 / htdocs / ppi_pop / exitpop / trunk / datatables / mysql.php): failed to open stream: No such file or directory in < b > /usr/local / zend / apache2 / htdocs / ppi_pop / exitpop / trunk / DataTables / examples / server_side / scripts / server_processing.php < /b> on line 24 < br / > < br / > < b > Warning < /b>: include(): Failed opening '/usr / local / zend / apache2 / htdocs / ppi_pop / exitpop / trunk / datatables / mysql.php ' for inclusion (include_path='.: /usr/local / zend / share / ZendFramework / library: /usr/local / zend / share / pear ') in /usr/local/zend/apache2/htdocs/ppi_pop/exitpop/trunk/DataTables/examples/server_side/scripts/server_processing.php on line 24

    [/quote]

    Followed bu the valid server-side response. So we need to resolve why a warning is being shown. It appears you are using the standard server-side processing script as you indicate, but that script doesn't do an include on a mysql.php file ( http://datatables.net/development/server-side/php_mysql ). Could you confirm what script it is that you are using please?

    Regards,
    Allan
  • mattmillenmattmillen Posts: 10Questions: 0Answers: 0
    Hi Allan,


    Great thanks, i added http://datatables.net/development/server-side/php_mysql and it works fine on your example.

    Then i have implemented it on my files i now get this message.

    Debug code: ekukat

    Any ideas what this may be as i have been playing around for a few hours now but just can't get it to work. I think its something pretty simple as i have your file in the same directory with same support files added and it works fine.

    I added this the the top of the script:

    $aColumns = array( 'email', 'mobile', 'ip_aaddress', 'browser', 'utmcsr', 'utmcmd', 'utmctr' );

    /* Indexed column (used for fast and accurate table cardinality) */
    $sIndexColumn = "id";

    /* DB table to use */
    $sTable = "leads";

    My table with the data in is 'leads' in the same database as 'ajax' i think maybe it is not picking up the table in the database or something.

    Any help much appreciated.

    Hope my description explains ok.

    Thanks in Advance


    Matt
  • mattmillenmattmillen Posts: 10Questions: 0Answers: 0
    Its ok, i have got it! thanks anyway it was id="datatable" missing from table
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Good to hear it is resolved :-)

    Allan
This discussion has been closed.