我有一个数据表来显示 MYSQL 数据库中的字段,但是我不断收到错误消息:
DataTables 警告(表 id =“我的表”):从数据源请求未知参数“0”
这是我的代码:
<table class="table table-striped table-bordered" id="sample_1">
<thead>
<tr>
<th style="width:8px;"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes" /></th>
<th>Username</th>
<th class="hidden-phone">Email</th>
<th class="hidden-phone">Points</th>
<th class="hidden-phone">Joined</th>
<th class="hidden-phone"></th>
</tr>
</thead>
<tbody>
<?php
$con = mysql_connect("localhost","cl49-XXX","XXX");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("cl49-XXX", $con)or die( "Unable to select database");
$result=mysql_query("SELECT * FROM products ")or die('You need enter a catagory ' );
echo "<tr>"; // first row beginning
for ($i = 1; $i <= mysql_num_rows($result); $i++)
{
$row = mysql_fetch_array($result);
$prodname = $row['prodname'];
$prodID = $row['prodID'];
$catagory = $row['catagory'];
echo "<tr class='odd gradeX'>
<td><input type='checkbox' class='checkboxes' value='1'/></td>
<td class='hidden-phone'>$prodID</td>
<td class='hidden-phone'>$prodname</td>
<td class='hidden-phone'>$catagory</td>
<td class='hidden-phone'><a href='deleteproduct.php?q=$prodID'><button class='btn btn-danger'type='submit'><font color='white'>Delete</font> </a>
";
echo "</tr><tr>"; // it's time no move to next row
}
echo "</tr>"; // last row ending
?>
</tbody>
</table>
有谁知道这个错误是什么意思?