0

アイテムを完全に表示するこのコードがありますが、「OK」をクリックしてページを表示する必要があるというエラーポップアップが表示されます

私はウェブを検索しましたが、これはヘッダーテーブルにデータ自体よりも多くの列があることに関係していることを理解しているので、これをトラブルシューティングしようとしましたが、私は初心者(noob)であるため、どこにも速くなりませんでした:/

誰かがこれに光を当てることができれば、それは素晴らしいことです! :)


エラー


DataTables warning (table id = 'example'): Requested unknown parameter '0' 
from the data source for row 0

マイコード


<?php
//include database connection
include 'db_connect.php';

//query all records from the database
$query = "select * from repair_jobs";

//execute the query
$result = $mysqli->query( $query );

//get number of rows returned
$num_results = $result->num_rows;

//this will link us to our add.php to create new record
if( $num_results > 0){ //it means there's already a database record

    //start table
    //creating our table heading
    echo "<table id='example' cellpadding='0' cellspacing='0' border='0' class='display' >";
    echo "<thead><tr>";
        echo "<th>Client</th>";
        echo "<th>Type</th>";
        echo "<th>Labour</th>";
        echo "<th>ourcosts</th>";
    echo "</thead></tr><tbody><tr class=\"gradeX\">";

    //loop to show each records
    while( $row = $result->fetch_assoc() ){
            //extract row
            //this will make $row['firstname'] to
            //just $firstname only
            extract($row);

            //creating new table row per record
            echo "<tr>";
                echo "<td>{$client}</td>";
                echo "<td>{$type}</td>";
                echo "<td>{$labour}</td>";
                echo "<td>{$ourcosts}</td>";
                                echo "</td>";
            echo "</tr>";
    }

    echo "</table>";//end table

}else{
    //if database table is empty
    echo "No records found.";
}

//disconnect from database
$result->free();
$mysqli->close();

?>

OKと表示されますが、このエラーは私を困惑させます。

4

0 に答える 0