Reputation:
When retrieving data from a MYSQL server it seems to be limiting the output results. Please refer to the following attachments
Code:
<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);
?>
Output results:
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
as you can see under the fault heading there should be more to what is displaying.
Upvotes: 0
Views: 100
Reputation:
I have found out the reason of this and it only clicked after i posted my responses. I had a 64vchar limit in mysql table. Changed it to 1024 and now works fine.
Upvotes: 0
Reputation: 219804
You have multiple errors with your output.
echo '<tr><td>Reference Number:</td><td>'; echo $row['ID'];'</td></tr>';
^^^^^^
Missing echo
This occurs on every row and will cause layout errors which may be hiding your content.
Upvotes: 2