datatable left join tables
datatable left join tables
Hey everyone,
Im having a problem with my code here ..
datatables.php code
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "TransDetails.contNum";
/* DB table to use */
$sTable = "TransDetails,VanSize ";
//for joins
$sJoin = " VanSize.VSId = TransDetails.Vansize ";
/* Database connection information */
$gaSql['user'] = "XX";
$gaSql['password'] = "XXXX";
$gaSql['db'] = "XXX";
$gaSql['server'] = "XXXXX";
/*
* 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('TransDetails.contNum','TransDetails.VanNum' ,'convert(varchar(3),VanSize.Size) + '-' + VanSize.Value' );
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* ODBC connection
*/
$connectionInfo = array("UID" => $gaSql['user'], "PWD" => $gaSql['password'], "Database"=>$gaSql['db'],"ReturnDatesAsStrings"=>true);
$gaSql['link'] = sqlsrv_connect( $gaSql['server'], $connectionInfo);
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
/* Ordering */
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) ) {
$sOrder = "ORDER BY ";
for ( $i=0 ; $i array()
);
while ( $aRow = sqlsrv_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
Im having a problem with my code here ..
datatables.php code
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "TransDetails.contNum";
/* DB table to use */
$sTable = "TransDetails,VanSize ";
//for joins
$sJoin = " VanSize.VSId = TransDetails.Vansize ";
/* Database connection information */
$gaSql['user'] = "XX";
$gaSql['password'] = "XXXX";
$gaSql['db'] = "XXX";
$gaSql['server'] = "XXXXX";
/*
* 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('TransDetails.contNum','TransDetails.VanNum' ,'convert(varchar(3),VanSize.Size) + '-' + VanSize.Value' );
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* ODBC connection
*/
$connectionInfo = array("UID" => $gaSql['user'], "PWD" => $gaSql['password'], "Database"=>$gaSql['db'],"ReturnDatesAsStrings"=>true);
$gaSql['link'] = sqlsrv_connect( $gaSql['server'], $connectionInfo);
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
/* Ordering */
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) ) {
$sOrder = "ORDER BY ";
for ( $i=0 ; $i array()
);
while ( $aRow = sqlsrv_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
This discussion has been closed.