How to run php scripts on button click? I have made a list of upcoming workshops and made a button to register for the workshops.On clicking apply button, i want to insert details of that student in the database. Here is my code.
<?php
include('connect_db.php');
$query = "select * from workshop";
$data = mysqli_query($con,$query);
echo "<table>";
while($row=mysqli_fetch_array($data, MYSQLI_ASSOC))
{
$wid = $row['Workshop_id'];
$wname = $row['Workshop_name'];
$inst = $row['Instructor'];
$dt = $row['Date'];
$tm = $row['Time'];
echo "<tr><td>$wname</td>";
echo "<td>$inst</td>";
echo "<td>$dt</td>";
echo "<td>$tm</td>";
echo "<td><button type='button' class = 'btn-primary' id =
'apply'>Apply</button></td>";
}
echo "</table>";
?>