誰でもこれでエラーが表示されますか? 2 番目のループで期待される結果が出力されません。2 番目のループ ヘッダーが問題なく出力される方法。
SQL データベースからデータを印刷しようとしています。
<?php
$con= new mysqli('localhost','root','','regional_data');
if (mysqli_connect_errno()) {exit('Connection failed: '. mysqli_connect_error());}
$result = mysqli_query($con,"SELECT * FROM newchk WHERE dist_chk='$distUsr'");
echo "<table cellpadding='2' class='tablet' cellspacing='0'>";
echo
"<tr>
<th></th>"
."<th>"."Starting Cheque No"."</th>"
."<th>"."Ending Cheque No"."</th>"
."<th>"."Total No of Cheques remaining"."</th>"
."<th>"."Cheque Type"."</th>"
."</tr>";
while ($reca = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td><input type='checkbox' ></td>";
echo "<td>".trim($reca["sbstart"])."</td>";
echo "<td>".trim($reca["sbend"])."</td>";
echo "<td>".trim($reca["totsb"])."</td>";
echo "<td>SB</td>";
echo "</tr>";
}
echo "</table>";
echo "<table cellpadding='2' class='tablet' cellspacing='0'>";
echo
"<tr>
<th></th>"
."<th>"."Starting Cheque No"."</th>"
."<th>"."Ending Cheque No"."</th>"
."<th>"."Total No of Cheques remaining"."</th>"
."<th>"."Cheque Type"."</th>"
."</tr>";
while ($reca = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td><input type='checkbox' ></td>";
echo "<td>".trim($reca["gwstart"])."</td>";
echo "<td>".trim($reca["gwend"])."</td>";
echo "<td>".trim($reca["totgw"])."</td>";
echo "<td>GW</td>";
echo "</tr>";
}
echo "</table>";
$con->close();
?>
</div>