- 13, May 2024
- #1
Привет, при переходе с MYSQL на MYSQLi (вот в чем вина) я не могу получить четкое представление о правильном коде.
для цикла while. Помоги пожалуйста. следующий код:
------------------------------------------------------
<html><body>
<hr>
<center><b><font size=+2> 515 Certification Expiration Report</font><br>06/22/2020 - 06/22/2021<p>
<hr>
<?php
//Open a new connection to the MySQL server
require_once "getprerentdb.php";
//MySqli Select Query
$results = $mysqli->query (SELECT * FROM waitlist);
?>
<table border=1>
<th>unit#</th>
<th>resident name</th>
<th>movein date</th>
<th>effect date</th>
<th>expire date</th>
<th>days left</th>
<th colspan=3>recertification notification</th>
</tr>
<?php
// ---------------------------------------
while($row = mysqli_fetch_array($result))
{
// ----------------------------------------
echo "<tr>";
echo "<td>" . $row['apt'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['moveindate'] . "</td>";
echo "<td>" . $row['effdate'] . "</td>";
echo "<td>" . $row['expdate'] . "</td>";
echo "<td>" . $row['daysleft'] . "</td>";
echo "<td>" . $row['90date'] . "</td>";
echo "<td>" . $row['60date'] . "</td>";
echo "<td>" . $row['30date'] . "</td>";
echo "</tr>";
echo "</table>";
}
?>
</body></html>
PHP: