0
有一個列出SQL的表,並且我在每一行都添加了一個按鈕,我希望它將其鏈接到另一個頁面。bootstrap按鈕並使用行數據將其鏈接到另一個頁面
問題是我想要那個按鈕來打開正確的數據行。
<div class="container">
<div class="jumpbotron">
<table class="table table-striped">
<thead>
<tr class="success">
<td>Date</td>
<td>Subject</td>
<td>Details</td>
<td>Status</td>
<td>ticket id</td>
<td>Actions</td>
</tr>
</thead>
<?php
while($row=mysqli_fetch_array($result))//while look to fetch the result and store in a array $row.
{
$date=$row[2];
$subject=$row[3];
$detail=$row[4];
$status=$row[5];
$tickid=$row[0];
?>
<form method="post">
<tbody method="post">
<td class="col-md-1"><?php print_r($date); ?></td>
<td class="col-md-1"><?php print_r($subject); ?></td>
<td class="col-sm-2"><?php print_r($detail); ?> </td>
<td class="col-md-1"><?php print_r($status); ?></td>
<td class="col-md-1"><?php echo $tickid ; ?></td>
<td class="col-md-1"><a href="detail.php" name="submit" id="submit"class="btn btn-sm btn-success">Details</td>
</tbody>
</form>
<?php } ?>
</table>
</div>
</div>
嗨,我試着用GET和回聲它。但我無法得到這個tickid。 – Sypnoticjr
如果您使用的是按下ctrl + shift + i,並確保您的錨標記的href是detail.php?id = something。 – Hienz