My code is posting the entire table. Instead, it should only post the selected like term..... $param="%{$_POST['search']}%";.
Sources: I mostly used these two articles to get my code: Display a table in a foreach loop with database values & php mysqli prepared statement LIKE
<table border="2" class="table-responsive" id="employee_table">
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Position</th>
<th>Date</th>
<th>Update</th>
</tr>
<?php
if(isset($_POST['search'])) {
echo "Search Successful!";
$stmt = $con->prepare("SELECT * FROM employees WHERE first_name LIKE ? OR last_name LIKE ?");
$param='%'.$_POST['search'].'%';
$stmt->bind_param('ss', $param, $param);
$stmt->execute();
$result = $stmt->get_result();
$i = 0;
while ($row = $result->fetch_array(MYSQLI_NUM)) {
foreach ($row as $r) {
$i++;
echo '<td> '.$r.'</td>';
if($i % 6==0){
echo '</tr><tr>';
}}}
}
?>
</tr>
</table>