我有一個php文件,我知道有一個地方的錯誤。當使用xampp在我的本地機器上使用它時,它工作正常,但是當上傳到主機時,我得到標題和導航,然後它說'出錯',從我的php代碼的檢查連接部分,並且不會製作桌子。其他頁面工作正常,並提交給數據庫,所以我假設connect.php頁面是正確的,它的代碼是錯的。我也已經告訴我的演講,這是代碼,但我在努力尋找問題php html在xampp上本地工作,但沒有上傳時
<?php
//uses the connect.php file to connect to the database
include('connect.php')
?>
<!DOCTYPE html>
<html>
<head>
<title>Extract data from DB </title>
<link rel="stylesheet" type="text/css" href="gcards.css">
</head>
<body>
<nav class="nav">
<h1>Gcards </h1>
<a href="get.php">Gcards</a>
<a href="insert.php">INSERT</a>
<a href="delete.php">DELETE</a>
</nav>
<?php
//query the database to extract relavent data
$get= "SELECT * FROM manufacturer
join
rating on manufacturer.manufacturerID = Rating.RatingID
join
model on manufacturer.manufacturerID = model.ModelID
join
ram on manufacturer.manufacturerID = ram.RamID
join
ram_type on manufacturer.manufacturerID = Ram_Type.Ram_TypeID
join
clock on manufacturer.manufacturerID = clock.ClockID";
// check connection
$data = mysqli_query($dbconnect, $get) or die('error getting');
echo "<table class=\"display\">";
echo "<tr><th>ID</th>
<th>Image_Url</th>
<th>Manufacturer</th>
<th>Series</th>
<th>Interface</th>
<th>Chipset</th>
<th>SLI-Cross Fire</th>
<th>Ram</th>
<th>Ram Type</th>
<th>Clock_Speed</th>
<th>Boost_Speed</th>
<th>OC_Speed</th></tr>";
while ($row = mysqli_fetch_array($data, MYSQLI_ASSOC)) {
echo "<tr>";
echo "</td><td>";
echo $row['ManufacturerID'];
echo "</td><td>";
?>
<img src ="<?php echo $row['Image_Url']; ?>"
height="100" width="125">
<?php
echo "<br>";
?>
<img src ="<?php echo $row['Rating']; ?>" width="125">
<?php
echo "</td><td>";
echo $row['Manufacturer'];
echo "</td><td>";
echo $row['Series'];
echo "</td><td>";
echo $row['Interface'];
echo "</td><td>";
echo $row['Chipset'];
echo"</td><td>";
echo $row['SLI_Crossfire'];
echo"</td><td>";
echo $row['RamNo'];
echo "</td><td>";
echo $row['Ram_Type'];
echo"</td><td>";
echo $row['Clock_Speed'];
echo"</td><td>";
echo $row['Boost_Speed'];
echo"</td><td>";
echo $row['OC_Speed'];
echo "</td></tr>";
echo "</table>";
}
?>
</body>
</html>
什麼是完整錯誤? – Daniel
theres沒有錯誤出現它只是不會,顯示錶時,我直接到網站頁面。 $ data = mysqli_query($ dbconnect,$ get)或死('error getting'); – Chris
我必須問:是否更新了憑據以匹配主機身份驗證? (而不是仍然設置爲您的本地配置?) –