我的代码在wampserver较低的服务器上运行良好,但是当我尝试转移到更高版本时。 wampserver 3.0,即使我使用mysqli面向对象类型也显示错误。但是当我通过mysql删除组。它已经有效但我需要使用group by。
注意:尝试获取非对象的属性
<?php
$sql = "SELECT * from barcode where status='COMPLETE' group by refnumber ORDER BY refnumber ASC ";
$result = $conn->query($sql);
if ($result->num_rows == 0)
{
echo " No Transactions for Today";
}
if ($result->num_rows > 0) {
echo "
<table class='table table-bordered table-hover table-condensed '>
<tr class='success'> <th>Ref.Number</th><th> Model </th> <th>Date Received</th><th>Time</th> <th>Status</th> <th>Received By</th> <th>Action</th>
</tr>";
$current_cat = null;
while($row = $result->fetch_assoc()) {
if ($row["refnumber"] != $current_cat) {
$current_cat = $row["refnumber"];
$current_cat2 = $row["datereceived"];
$current_cat3 = $row["status"];
$current_cat4 = $row["datetime"];
$current_cat5 = $row["user"];
echo "<tr><td>";
echo"
{$current_cat}</td> <td><a href='viewitem.php?Rid=".$row['refnumber']."')>View</a></td> <td>{$current_cat2}</td> <td>{$current_cat4}</td><td>{$current_cat3}</td><td>{$current_cat5}</td>
";?>
<td>
<a href="print_pdf.php?Rid=<?=$row['refnumber']?>" target="_TOP">Print</a>
</td>
<?php
}}}
";?>
</table>