-2
PHP MySQLiを使用してテーブル(HTMLテーブル)に情報を表示しようとしています。私は現在作成したウェブページでエラーが発生しています。イメージは自分のページとエラーのイメージを表示します。PHP MySQLiを使用したHTMLテーブル
<?PHP
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "ip_site_database_project";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM site";
$result = mysqli_query($conn, $sql);
echo "<table border='1' align ='center'>";
echo "<tr>";
echo "<td>Site ID</td>";
echo "<td>Site Name</td>";
echo "<td>Site Type</td>";
echo "<td>Description</td>";
echo "<td>Site Dial Code</td>";
echo "<td>Site Number Range (Start)</td>";
echo "<td>Site Number Range (End)</td>";
echo "<td>Site Active Since</td>";
echo "<td>Site Ceased Date</td>";
echo "</tr>";
while($rowitem = mysqli_fetch_array($results))
{
echo"<tr>";
echo "<td>" . $rowitem[Site_ID] . "</td>";
echo "<td>" . $rowitem[Site_Name] . "</td>";
echo "<td>" . $rowitem[Site_Type] . "/td>";
echo "<td>" . $rowitem[Description] . "</td>";
echo "<td>" . $rowitem[Site_Dial_Code] . "/td>";
echo "<td>" . $rowitem[Site_Number_Range_Start] . "</td>";
echo "<td>" . $rowitem[Site_Number_Range_End] . "/td>";
echo "<td>" . $rowitem[Site_Active_Since] . "</td>";
echo "<td>" . $rowitem[Site_Ceased_Date] . "/td>";
echo "</tr>";
}
echo"</table>";
$conn->close();
?>
誤植 – Saty