Can't get MSSQL server side processing working

Can't get MSSQL server side processing working

pmirandapmiranda Posts: 10Questions: 0Answers: 0
edited October 2013 in DataTables 1.9
Hi!
i'm trying to put datatables server-side processing to work and the only thing that I get is an empty table.
I've submitted the table to datatable's debugger and it answered to me with this code: ohudir
Can you give me some help?
Thanks in advance.

Paulo

Replies

  • pmirandapmiranda Posts: 10Questions: 0Answers: 0
    btw, it's important to mention that the php script, which is below, works fine:

    <?php
    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * Setar variaveis
    */

    // colunas do banco de dados
    $aColumns = array( 'column1', 'column2', 'column3', 'column4', 'column5' );

    /* Informacoes sobre o MSSQL Database */
    $host = 'meu_host';
    $user = "meu_usuario";
    $pass = "minha_senha";
    $db = "meu_banco";

    /* Conexao ao MSSQL */
    $conn = sqlsrv_connect($host, array('UID'=>$user, 'PWD'=>$pass, 'Database'=>$db));

    /* coluna Indexada */
    $sIndexColumn = "id_cadastro";

    /* Tabela do Banco */
    $sTable = "Cadastro_Geral";

    /*
    * Funcoes locais
    */
    function fatal_error ( $sErrorMessage = '' )
    {
    header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
    die( $sErrorMessage );
    }


    /* Ordenamento */
    $sOrder = "";
    if ( isset( $_GET['iSortCol_0'] ) )
    {
    $sOrder = "ORDER BY ";
    for ( $i=0 ; $i $iTotal,
    "iTotalDisplayRecords" => $iFilteredTotal,
    "aaData" => array()
    );

    do {
    while ( $aRow = sqlsrv_fetch_array( $rResult, SQLSRV_FETCH_ASSOC ) ) {
    $row = array();
    for ( $i=0 ; $i
  • pmirandapmiranda Posts: 10Questions: 0Answers: 0
    Maybe this can be useful. It's the json returned:

    {"sEcho":0,"iTotalRecords":142261,"iTotalDisplayRecords":142261,"aaData":[[39,"ALEX ","3464-9999","7575-9999",null],[40,"MARIA DE FATIMA ",null,null,null],[41,null,"3278-9999","",null],[42,null,null,null,null],[43,"BRUNO CESAR","2269-9999","8862-9999",null],[45,"DULCINEIA ",null,null,null],[47,null,"3276-9999","8197-9999",null],[48,"GEZONITA","2596-9999","9110-9999",null],[49,"JOSE CARLOS","2578-9999","9813-9999",null],[51,"LUCIA ",null,"9621-9999",null]]}
  • pmirandapmiranda Posts: 10Questions: 0Answers: 0
    Hei! Is there anyone out there to give me some help? I'm lost! Please!
This discussion has been closed.