+------------------+
| Tables_employees |
+------------------+
| empid |
| aid |
| FirstName |
| LastName |
| Email |
| Phone |
<table id="exampleC" class="display" cellpadding="1" cellspacing="1" width="" style="font-size:small;">
<thead>
<tr>
<th>1st Name</th>
<th>2nd Name</th>
<th>Title</th>
<th>Email</th>
<th>Phone(D)</th>
<th>Linkedin</th>
</tr>
</thead>
<tbody>
<?php
require_once 'tabconnect.php';
if (isset($_GET['id'])) {
$id = $_GET['id'];
$data = mysqli_query($connection,"SELECT acquisition.aid,acquisition.aby,employees.empid,employees.aid,employees.FirstName,employees.LastName,employees.title,employees.email,employees.phone,employees.dphone,employees.LIUrl,employees.listatus FROM employees JOIN acquisition ON acquisition.aid=employees.aid where acquisition.aid=$id");
while ($row3 = mysqli_fetch_array($data)) { ?>
<tr>
<td><?php echo $row3['FirstName']; </td>
<td><?php echo $row3['LastName']; ?</td>
<td><?php echo $row3['title']; ?></td>
<td><a class="" href="<?php echo $row3['email']; ?>" target="_blank"><i class="icon-custom icon-sm rounded-x fa fa fa-envelope"></i></td>
<td><a class="" href="<?php echo $row3['phone']; ?>" target="_blank"><i class="icon-custom icon-sm rounded-x fa fa-phone"></i></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
問題是,它會顯示所有的電子郵件和電話中的圖像,但我想顯示圖像時,纔會有會在表中的記錄不顯示從MySQL表中的PHP空的結果
您需要在SQL注入閱讀起來。 – jeroen
很高興看到一些示例表格數據以及您實際想要在PHP中顯示的內容。 –
你的問題不清楚你想要什麼。只有在存在圖像數據時才顯示圖像的最後一行,或者只有存在圖像時才顯示其他數據? – Sand