當從MYSQL服務器中檢索數據時,它似乎限制了輸出結果。請參考下面的附件MYSQL和PHP輸出數據限制
代碼:
<style>
tr,td {
border:1px red solid;
}
</style>
<?php
include('./connect.php');
if (!$connect) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysqli_select_db($connect, db_name);
if (!$db_selected) {
die('Can\'t use ' . db_name . ': ' . mysql_error());
}
//execute the SQL query and return records
$result = mysqli_query($connect, "SELECT * From jobs ORDER BY id DESC LIMIT 1");
echo "<table style='border:1px solid red'>";
while($row = mysqli_fetch_array($result)) {
echo '<tr><td>Reference Number:</td><td>'; echo $row['ID'];'</td></tr>';
echo '<tr><td>First Name:</td><td>'; echo $row['FirstName'];'</td></tr>';
echo '<tr><td>LastName:</td><td>'; echo $row['LastName'];'</td></tr>';
echo '<tr><td>Phone Numbner:</td><td>'; echo $row['Phone'];'</td></tr>';
echo '<tr><td>Email:</td><td>'; echo $row['Email'];'</td></tr>';
echo '<tr><td>Items:</td><td>'; echo $row['Items'];'</td></tr>';
echo '<tr><td>Fault:</td><td style="width:100%">'; echo $row['Issue'];'</td></tr>';
}
echo "</table>";
//close connection
mysqli_close($connect);
?>
輸出結果:
Connected successfully
Reference Number: 100000
First Name: Jane
LastName: Doe
Phone Numbner: 3372555897
Email: [email protected]
Items: laptop
Fault: Client states her laptop will no longer power on. However, p
,你可以在錯誤的標題應該有更多的什麼是顯示下看。
首先,你不會輸出你的''字符串在行尾(如果這是確切的代碼)。不管你的瀏覽器是補償這個還是創建一個大型的鳥巢模型都很難說。但是,那麼你不會在任何地方回顯「連接成功」,所以我猜這不是*代碼 – Rudu
我認爲瀏覽器正在補償。我已經修復了缺失的回聲,沒有任何改變。 回聲連接來自include('./ connect.php'); –
旁註:你在與'mysql_error()'混合使用,它應該讀作'mysqli_error($ connect)' –