Php 呈现表格时会弹出错误“;“数据表警告”;
我有这个代码,将显示完美的项目,但有一个错误弹出窗口,我必须点击“确定”太查看页面 我曾在网上搜索过,据我所知,这与标题表的列数多于数据本身有关,我曾试图解决这一问题,但由于我是一名新手(noob),所以没有什么进展:/ 如果有人能对此有所了解,那就太好了!:)Php 呈现表格时会弹出错误“;“数据表警告”;,php,mysqli,Php,Mysqli,我有这个代码,将显示完美的项目,但有一个错误弹出窗口,我必须点击“确定”太查看页面 我曾在网上搜索过,据我所知,这与标题表的列数多于数据本身有关,我曾试图解决这一问题,但由于我是一名新手(noob),所以没有什么进展:/ 如果有人能对此有所了解,那就太好了!:) 错误 我的代码 为什么你认为这段代码与错误信息有关?我做了noob的事,谷歌把它删掉了。。。。为什么会是什么/ DataTables warning (table id = 'example'): Requested unkno
错误
我的代码
为什么你认为这段代码与错误信息有关?我做了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();
?>