if (postVar('sSearch') !="" ) {
$sWhere = " WHERE Line LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' OR ".
"Model LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' OR ".
"NIK LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' ";
}
$sQuery = "SELECT Line, Model, NIK FROM inspection_report ".$sWhere.$sOrder.$sLimit;
$rResult = mysql_query( $sQuery) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() );
$sQuery = "SELECT Line, Model, NIK FROM inspection_report ".$sWhere.$sOrder.$sLimit;
$rResult = mysql_query( $sQuery) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() );
$sQuery = "SELECT FOUND_ROWS()";
$rResultFilterTotal = mysql_query( $sQuery) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() ); // submit SQL to My$
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
$iFilteredTotal = $aResultFilterTotal[0];
$sQuery = "SELECT COUNT(Line) FROM inspection_report";
$rResultTotal = mysql_query( $sQuery) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() ); // submit SQL to MySQL an$
$aResultTotal = mysql_fetch_array($rResultTotal);
$iTotal = $aResultTotal[0];
$sOutput = '{';
$sOutput .= '"sEcho": '.$sEcho.',';
我一直在使用该代码,但为什么结果为空? {"sEcho": ,
答案 0 :(得分:0)
$sOutput = '{';
$sOutput .= '"sEcho": '.intval($_POST['sEcho']).',';
$sOutput .= '"iTotalRecords": '.$iTotal.', ';
$sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
$sOutput .= '"aaData": [ ';