raw sql query?

raw sql query?

taylor5042taylor5042 Posts: 21Questions: 6Answers: 0

Allen,
I am trying to figure out the same thing answered here: https://datatables.net//forums/discussion/35858
Could you help me understand this with a basic example?

Answers

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

    There is example code in the thread you linked to - perhaps you could show me what you are currently using and any error messages that you are getting?

    Allan

  • taylor5042taylor5042 Posts: 21Questions: 6Answers: 0

    I guess I was hoping for a full example with HTML code, etc.
    I figured that part out after striping down one of my editor html, php, and js files.
    I did run into this error 500 when trying to use the json_encode, but this link helped me fix it.
    https://datatables.net/forums/discussion/comment/103300/#Comment_103300

    //echo json_encode( $data ); //original 
    //echo json_encode( [ "data" => $data ] ); //error 500
    echo json_encode(array("data" => $data)); //working example
    
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    //echo json_encode( [ "data" => $data ] ); //error 500

    If that gave an error, its probably because your server is using PHP 5.3. The [] short hand syntax was introduced with 5.4.

    Good to hear you have it going now.

    Allan

This discussion has been closed.