basically i have this problem of having a button in a while loop to work the way i wanted it to. I have like say 5 rows echoed from my database in a while loop and each of them have a submit button. What i need it to function like is say i press the first row submit button, it will bring over all the data only from the first row to the form handling and update the row in the database. So when i post the data over it should only contain from that row i selected.
The table is something like that
while ($row = mysqli_fetch_array($result)) {
<td>
<td><?php echo $jobid; ?></td>
<td><?php echo $jobname; ?></td>
<input type="submit" />
</td>
The form handling is something like that
$candidate_id = $_POST['can_id'];
$job_id = $_POST['job_id'];
$can_name =$_POST['can_name'];
$job_name =$_POST['job_name'];
$company_name =$_POST['company_name'];
$interviewer =$_POST['interviewer_name'];
$date =$_POST['date_pick'];
$email =$_POST['email'];
$insertQuery = "UPDATE application SET Email_checked = '1', Interview_person ='$interviewer', Interview_datetime = '$date' WHERE Candidate_id = $candidate_id AND Job_id = $job_id";
$inserted = mysqli_query($link, $insertQuery) or die(mysqli_error($link));
From the image when i press the button "1", no matter which button i press it just changes the last one. Also i am attempting an email function for the specific row