I have a mysql database set up with code to search it using tabs. I want to add an edit button on each row that opens up the update.php I have already made. Any help would be great.
<?php
include("config.php");
if(isset($_POST['input'])){
$input= $_POST['input'];
$query= "SELECT * FROM tracking WHERE Title LIKE '%{$input}%' OR Analyst LIKE '%{$input}%'OR Agency LIKE '%{$input}%'
OR Date LIKE '{$input}%'OR Requester LIKE '%{$input}%'OR Firearm LIKE '{$input}%'OR Summary LIKE '%{$input}%' OR ID LIKE '{$input}%'
ORDER BY Date DESC";
$results = mysqli_query($con, $query);
if(mysqli_num_rows($results) >0){?>
<p><b>Total Records - <span id="total_records"></span></b></p>
<table class="table-responsive">
<thead>
<th>ID</th>
<th>Title</th>
<th>Analyst</th>
<th>Agency</th>
<th>Date</th>
<th>Requester</th>
<th>Firearm</th>
<th>Packets</th>
<th>Packets1</th>
<th>Summary</th>
</thead>
<tbody>
<?php
while($row=mysqli_fetch_assoc($results)){
$ID=$row['ID'];
$Title=$row['Title'];
$Analyst=$row['Analyst'];
$Agency=$row['Agency'];
$Date=$row['Date'];
$Requester=$row['Requester'];
$Firearm=$row['Firearm'];
$Packets=$row['Packets'];
$Packets1=$row['Packets1'];
$Summary=$row['Summary'];
?>
<tr>
<td><?php echo $ID;?></td>
<td><?php echo $Title;?></td>
<td><?php echo $Analyst;?></td>
<td><?php echo $Agency;?></td>
<td><?php echo $Date;?></td>
<td><?php echo $Requester;?></td>
<td><?php echo $Firearm;?></td>
<td><?php echo $Packets;?></td>
<td><?php echo $Packets1;?></td>
<td><?php echo $Summary;?></td>
<td><?php echo "<td><a href='update.php?ID=" . $row['ID'] . "'>edit</a></td>"; ?></td> //THIS IS THE LINE I ADDED
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}else{
echo "<h6 class='text-danger text-center mt-3'>No Entry Found</h6";
}
}
?>