我在PHP代碼加入兩個表寫了一個MySQL查詢不工作,但我不希望在結果sql查詢在我的網頁
我地點的詳細信息表中的所有列:
我的登記表:
我的代碼
<?php
$con= mysqli_connect("localhost", "root", "", "project");
if(!$con)
{
die('not connected');
}
$result= mysqli_query($con, "SELECT placedetails.name,placedetails.doj,placedetails.total,placedetails.stay,placedetails.food,placedetails.travel,registration.username
FROM placedetails inner join registration on placedetails.id=registration.id ;");
?>
<div class="container">
<CENTER><h2>view Booking Details</h2>
<table class="table table-bordered">
<th>place</th>
<th>Travelling Date</th>
<th>Total Cost</th>
<th>Stay cost</th>
<th>Food cost</th>
<th>Travelling cost</th>
<th>User ID</th>
<?php
while($row =mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['doj']; ?></td>
<td><?php echo $row['total'] ;?></td>
<td><?php echo $row['stay'] ;?></td>
<td><?php echo $row['food'] ;?></td>
<td><?php echo $row['travel'] ;?></td>
<td><?php echo $row['username'] ;?></td>
<td><img src='".$row['choose']."'/></td>";
</tr>
<?php
}
?>
</table>
</div>
我寫我的代碼,它的執行,但問題是數據不執行,有人可以幫助我與我的問題。
嘗試運行在你的phpmyadmin這個查詢,看看你得到任何結果 – Akintunde007
同樣喜歡網絡的showng onlt兩個表的id科拉姆內科拉姆名字和我和我的價值觀不一樣@Akin – gudisa
如果ID的不匹配,那麼你不會得到任何結果 –