I need to add a check box on the end of each value in my html table that will be checked if the user would like to remove that value from the mysql database, my current cod elooks like this:
<?php
$con = mysqli_connect("localhost", "root", "", "numbers") or die(mysqli_error($con));
// Check connection
$result = mysqli_query($con,"SELECT * FROM usernumdata");
echo "<table border='1'>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Phone Number</th>
<th>Date Added</th>
<th>Time Added</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['firstname'] . "</td>";
echo "<td>" . $row['lastname'] . "</td>";
echo "<td>" . $row['numb'] . "</td>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['time'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
Obviously from my setup i would like if the user could click multiple checkboxes from the table and delete them all at once. Ive attached an image of what the table looks like now.
While im at it i would like to know if there is a way to check to see if multiples of the same number in the table already exist, that way i could keep the user from submitting multiples of the same thing, how would i go about checking this?