0
我創建一個數據庫,並創建HTML腳本的表與沒有寄宿=姓「回來的時候,表中的HTML數據庫中沒有顯示
while($row = mysqli_fetch_array($result)) {
echo "";
echo "" . $row['Firstname'] . "";
echo "" . $row['Lastname'] . "";
echo "";
}
echo "";
mysqli_close($con); ?>
這裏是我創建的代碼,可能有人看它告訴我我做了什麼錯?
<?php
$con=mysqli_connect("localhost","root","","Franchise_Call_Log");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM caller_info");
echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
th>Franchise</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Firstname'] . "</td>";
echo "<td>" . $row['Lastname'] . "</td>";
echo "<td>" . $row['Franchise'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
你錯過了一些代碼發佈它們。 – 2013-12-11 05:13:06
什麼是您的文件名以及您在哪裏運行此腳本(wamp/lamp/xammp)? – Roopendra
發佈您輸出的內容。 –