Step by step - JSON/PHP/MySQÇ

Step by step - JSON/PHP/MySQÇ

gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
edited April 2013 in Editor
http://editor.datatables.net/tutorials/api_manipulation
Please, I would like to make it work for me
Step by step, I can not use examples
thanks

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Have you gone through the installation instructions and have Editor installed and running first: https://editor.datatables.net/tutorials/installing ?

    Secondly, what part of the linked tutorial are you struggling with? Perhaps I can clarify it if there are some points which are not clear.

    Allan
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    I got some tests here, however now is generating this error:

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

    I realize that my problem is focused part of PHP connection with MySQL database

    Gladson
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    May notice that the message is generated:

    http://www.stonestecnologia.com.br/editor/

    *** I'm sorry but my english is not the best ***

    Gladson
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Thanks for the link. Very likely this error is caused by using PHP 5.2 or older. The Editor libraries require PHP 5.3 or newer.

    The PHP libraries that come with Editor 1.2+ require PHP 5.3 or newer, as they take advantage of the newer features that are available since 5.3, including closures and namespaces, to present a much cleaner API.

    If it is possible, I'd very much suggest updating to a newer version of PHP (indeed the PHP folks encourage upgrades since 5.2 was EOL in 2010).

    Having said that, Editor 1.0 and 1.1 had PHP libraries which did offer PHP 5.2 support which I can mail over to you if you cannot upgrade. However, keep in mind that they are not as feature complete as the new libraries and have a different API.

    Allan
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    Good Morning !

    Thanks, I'll do some testing, and any questions you ask.

    Gladson
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    Allan,

    Actually the version of PHP on my hosting is PHP 5.2.

    However already requested migration to current versions, I'm waiting.

    I did the tests on a local server and it worked correctly;

    Now go to the second stage in my job.

    Thank you

    Gladson
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    www.stonestecnologia.com.br/editor

    www.stonestecnologia.com.br/php <- Version !!
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    If you look at the reply from the server, you'll be able to see the following (which is what is making the response invalid JSON):

    [code]
    Warning: ini_set() has been disabled for security reasons in /home/stoneste/public_html/editor/php/lib/config.php on line 4

    [/code]

    You can safely just comment out or remove the `ini_set()` line from config.php - its just an attempt to get some debugging information if we need it.

    Allan
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    On the server? where I see it? how you encountered this error message?
    When I test on my local machine is not any error.

    Gladson
  • zazzaz Posts: 3Questions: 0Answers: 0
    You can see this error message with firebug..
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Yup - with Firebug or with WebKit's Inspector. Just use the Network tab and you'll be able to see the XHR with the request and data retrieved.

    Allan
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    http://www.stonestecnologia.com.br/editor
    http://www.stonestecnologia.com.br/php <- Version !!

    On the server? where I see it? how you encountered this error message?
    When I test on my local machine is not any error.

    Gladson
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    There is no error now when I load your /editor page. It populates the table correctly :-).

    Regarding Firebug and Ajax debugging - this introduction video might be useful: http://www.youtube.com/watch?v=W4jXAaEMp2M . There are also a lot of other tutorials for WebKit's Inspector and Firebug available on the web.

    Allan
This discussion has been closed.