PHP/MSSQL returns $secho on server_processing.php page
PHP/MSSQL returns $secho on server_processing.php page
smd
Posts: 7Questions: 0Answers: 0
Good evening,
I've been pulling my hair out over this and can't seem to identify where the issue lies. When I run the HTML page it indicates the JSON cannot be parsed and is invalid, however, when I run the server processing file all it returns is the secho query
"SELECT TOP 10 Filename,SenderId,ReceiverId,ControlNumber FROM Interchange WHERE SenderId NOT IN ( SELECT SenderId FROM ( SELECT TOP 0 Filename,SenderId,ReceiverId,ControlNumber FROM Interchange ) as [virtTable] ) : Array"
I'm not sure where to go from here, I've searched the forums high and low and can't seam to find a similar example. Any help in resolving this issue would be greatly appreciated.
Here is the link to the debug http://debug.datatables.net/acofiq
Thanks!
Here is my server processing file
[code]<?php
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "SenderId";
/* DB table to use */
$sTable = "Interchange";
$gaSql['server'] = "LPV-FINCSFS01\EDID";
$gaSql['db'] = "999";
$connectionInfo = array("Database"=>$gaSql['db'],"ReturnDatesAsStrings"=>true);
$gaSql['link'] = sqlsrv_connect( $gaSql['server'], $connectionInfo);
$params = array('Filename', 'SenderId', 'RecieverId', 'ControlNumber');
/*
* Columns
* If you don't want all of the columns displayed you need to hardcode $aColumns array with your elements.
* If not this will grab all the columns associated with $sTable
*/
$aColumns = array('Filename', 'SenderId', 'ReceiverId', 'ControlNumber');
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/* Ordering */
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) ) {
$sOrder = "ORDER BY ";
for ( $i=0 ; $i $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = sqlsrv_fetch_array( $rResult ) ) {
$row = array();
for ( $i=0 ; $i[/code]
and here is my .html file
[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
999 Reconciliation
@import "/dt/media/css/demo_page.css"; @import "/dt/media/css/header.css";
@import "/dt/media/css/demo_table_jui.css";
@import "/dt/examples/examples_support/themes/ui-lightness/jquery-ui-1.8.4.custom.css";
// data table basic initialisation
jQuery(document).ready(function() {
$('#Test').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/dt/examples/server_side/scripts/server_processing.php"
} );
});
999 Reconciliation
Filename
SenderId
ReceiverId
ControlNumber
Loading data from server
[/code]
I've been pulling my hair out over this and can't seem to identify where the issue lies. When I run the HTML page it indicates the JSON cannot be parsed and is invalid, however, when I run the server processing file all it returns is the secho query
"SELECT TOP 10 Filename,SenderId,ReceiverId,ControlNumber FROM Interchange WHERE SenderId NOT IN ( SELECT SenderId FROM ( SELECT TOP 0 Filename,SenderId,ReceiverId,ControlNumber FROM Interchange ) as [virtTable] ) : Array"
I'm not sure where to go from here, I've searched the forums high and low and can't seam to find a similar example. Any help in resolving this issue would be greatly appreciated.
Here is the link to the debug http://debug.datatables.net/acofiq
Thanks!
Here is my server processing file
[code]<?php
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "SenderId";
/* DB table to use */
$sTable = "Interchange";
$gaSql['server'] = "LPV-FINCSFS01\EDID";
$gaSql['db'] = "999";
$connectionInfo = array("Database"=>$gaSql['db'],"ReturnDatesAsStrings"=>true);
$gaSql['link'] = sqlsrv_connect( $gaSql['server'], $connectionInfo);
$params = array('Filename', 'SenderId', 'RecieverId', 'ControlNumber');
/*
* Columns
* If you don't want all of the columns displayed you need to hardcode $aColumns array with your elements.
* If not this will grab all the columns associated with $sTable
*/
$aColumns = array('Filename', 'SenderId', 'ReceiverId', 'ControlNumber');
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/* Ordering */
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) ) {
$sOrder = "ORDER BY ";
for ( $i=0 ; $i $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = sqlsrv_fetch_array( $rResult ) ) {
$row = array();
for ( $i=0 ; $i[/code]
and here is my .html file
[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
999 Reconciliation
@import "/dt/media/css/demo_page.css"; @import "/dt/media/css/header.css";
@import "/dt/media/css/demo_table_jui.css";
@import "/dt/examples/examples_support/themes/ui-lightness/jquery-ui-1.8.4.custom.css";
// data table basic initialisation
jQuery(document).ready(function() {
$('#Test').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/dt/examples/server_side/scripts/server_processing.php"
} );
});
999 Reconciliation
Filename
SenderId
ReceiverId
ControlNumber
Loading data from server
[/code]
This discussion has been closed.