私は、Artistテーブルからすべてのデータを出力し、確立されたテーブルに出力する非常に簡単なクエリを書きました。私はデータベースを二重チェックして、すべてのスペルは正しいですが、何らかの理由で何らかのデータが出力されていません。MySQL Artistテーブルのデータをすべて出力しないのはなぜですか?
コネクタコード
<?php
$conn = mysqli_connect("localhost", "b4014107", "Windows1", "b4014107_db2") or die (mysqli_connect_error());
?>
メインコード
!DOCTYPE HTML>
<html>
<head>
<title>View Artist Table</title>
</head>
<body>
<?php
//Includes speicifed details in order to connect to MySQL
include('ConnectorCode.php');
//mysql_query command is used to select data from Artist table
$result = mysqli_query("SELECT * FROM tbl_Artist");
echo "<table border='1'>";
echo "<tr> <th>Artist ID</th> <th>Artist Name</th> </tr>";
//Results are looped and then displayed in tables
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row ['Artist_id'] . "</td>";
echo "<td>" . $row ['Artist_Name'] . "</td>";
echo "</tr>";
}
echo "</table>";
//Connection is closed
mysqli_close($conn);
?>
<p><a href="ArtistNew.php">Add a new Artist</a></p>
<p><a href="ArtistEdit.php">Edit a current Artist</a></p>
</body>
</html>
私が間違って何をしているのですか?
「error_reporting(E_ALL)」をオンにします。あなたは警告を受け取りますか? – Barmar
データなしでコネクタファイルを提供してください。 –
申し訳ありません、コネクターファイルをページに追加しました。 –