数据表:结果在一列之后不显示

时间:2012-12-26 09:10:16

标签: php datatable

我的数据表只是显示“处理”而不是结果。在我尝试从我的数据库中的列显示另一个结果后发生了这种情况。我第一次只显示8列(包括隐藏的ID列)。 但是,在我添加1列后,它变为: enter image description here 我在添加Detail列之后得到了这个。 是否,如果数据显示表格变得更宽,所以它显示如下?查询和firebug没有错误显示错误。

if($ssWhere!="") {
                $sQuery = "SELECT prob_id,Model,Serial,Lotno,Date,Symptom,Cause,Status,CM,`Detail` FROM OQC ".$ssWhere.$sOrder.$sLimit;
                 } else {
                        $sQuery = "SELECT prob_id,Model,Serial,Lotno,Date,Symptom,Cause,Status,CM,`Detail` FROM OQC ".$sWhere.$sOrder.$sLimit;
                        }
        $rResult = mysql_query( $sQuery) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() );  // subm$

        $sQuery = "SELECT FOUND_ROWS()";
        $rResultFilterTotal = mysql_query( $sQuery) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() $
        $aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
        $iFilteredTotal = $aResultFilterTotal[0];

        $sQuery = "SELECT COUNT(prob_id) FROM OQC";

        $rResultTotal = mysql_query( $sQuery) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($sql) . '</small>): ' . mysql_error() );  //$
        $aResultTotal = mysql_fetch_array($rResultTotal);
        $iTotal = $aResultTotal[0];

//echo "sEcho is ".$_POST['sEcho'];

        $sOutput = '{';
        $sOutput .= '"sEcho": '.intval($_POST['sEcho']).',';     //   '.intval($_POST['sEcho']).', ';
        $sOutput .= '"iTotalRecords": '.$iTotal.', ';
//      $sOutput .= '"iTotalDisplayRecords": '.$iFilteredTotal.', \';
        $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
        $sOutput .= '"aaData": [ ';
        while ( $aRow = mysql_fetch_array( $rResult ) )
        {
                $sOutput .= "[";
                $sOutput .= '"'.addslashes($aRow['prob_id']).'",';
                $sOutput .= '"'.addslashes($aRow['Model']).'",';
                $sOutput .= '"'.addslashes($aRow['Serial']).'",';
                $sOutput .= '"'.addslashes($aRow['Lotno']).'",';
                $sOutput .= '"'.addslashes($aRow['Date']).'",';
                $sOutput .= '"'.addslashes($aRow['Symptom']).'",';
                $sOutput .= '"'.addslashes($aRow['Cause']).'",';
                $sOutput .= '"'.addslashes($aRow['Status']).'",';
                $sOutput .= '"'.addslashes($aRow['CM']).'",';
                $sOutput .= '"'.addslashes($aRow['Detail']).'"';
                $sOutput .= "],";
        }
        $sOutput = substr_replace( $sOutput, "", -1 );
        $sOutput .= '] }';

        echo $sOutput;

如果没有显示Detail,则一切都能正常工作。为什么?


在萤火虫节目中: Result

1 个答案:

答案 0 :(得分:0)

您好需要在jquery datatable脚本中提及列名。

相关问题