我有一个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
我必须问:是否更新了凭据以匹配主机身份验证? (而不是仍然设置为您的本地配置?) –