答案 0 :(得分:0)
尝试使用它。
<?php
foreach($dbo->query($query) as $row) {
$id = $row['ID'] ?? "";
$name = $row['NAME'] ?? "";
$brn = $row['BRN'] ?? "";
$address = $row['Registered Address'] ?? ""; //might be here is your error. because array key should be have spaces.
echo "<tr><td>$id</td><td>$name</td><td>$brn</td><td>$address</td></tr>";
}
仅供参考:如果您使用的是PHP 7+,则可以使用??
,否则使用$val? true: false