How can I add a JavaScript alert to confirm (yes or no) when the user clicks the delete button? I tried adding a class to an alert:
<?php
//$con = mysqli_connect("localhost", "root", "root", "db");
$sql = "SELECT * FROM `uploads` where userId = " . $_SESSION['user'];
$qry = mysqli_query($conn,$sql) or die(mysqli_error($conn));
$table_content = "";
while($row = mysqli_fetch_assoc($qry)){
$id = $row['id'];
$name = $row['name'];
$table_content .= "<tr>
<td>
<a href='listen.php?id=$id' target='_new'>$name </a>
</td>
<td>
<a href='delete.php?id=$id' type='button' class='btn btn-danger'>delete</a>
</td>
</tr>";
}
echo "<table>".$table_content."</table>";
?>