I'm a vba developer so I'm getting very confused on how to parse a record ID to isset(). I've looked at various posts here and have tried numerous things but the record will not delete. The page refreshes. The isset must be failing. I tried giving name & value but the combinations I used just did not work.
<?php
session_start();
$user_mail = $_SESSION['username'];
if ($user_mail) {
include 'database/db.php';
if(isset($_GET['delete_id'])) {
$sql_query="DELETE FROM `job_request` WHERE job_request.job_id=".$_GET['delete_id']." AND job_request.Email='$user_mail'";
mysql_query($sql_query);
header("Location: applied_jobs.php");
}
?> etc ...
It is used in this manner:
<?php
$result = mysql_query("SELECT * FROM `jobs` INNER JOIN job_request ON job_request.job_id=jobs.ReqID where job_request.Email='$user_mail' ORDER BY job_request.Applied_Date DESC");
$n = mysql_num_rows($result);
if ($n > 0) {
while ($row = mysql_fetch_array($result)) {
?>
<div id="lb" class="col-md-12" >
<h4 style="color:black;"><?php echo $row['Job_Title'] ?>
<a href="applied_jobs.php?delete_id=<?php echo $row['job_id']; ?>" onclick="return confirm('Delete this record?');" data-placement="top" data-toggle="tooltip" title="Delete Record">
<button class="btn-danger btn-md pull-right" data-title="Delete"> <span class="glyphicon glyphicon-trash"></span></button></a>
</h4>
Thanks In Advance for any insight on setting the job_id variable to delete the record