When i click this button my page is forwarded to a removeRowValue.php page:
<a href="/includes/incl/removeRowValue.php?name=ontvangenklantdatum"><button type="button" class="btn btn-default">Empty</button></a>
My removeRowValue.php page:
<?php
session_start();
$str = (int) $_SESSION['rights'];
$accptList = array(1,3);
if(!in_array($str, $accptList)){
header('Location: index.php?pagina=login');
}
require('conn.inc.php');
$getName = filter_input(INPUT_GET, "name", FILTER_SANITIZE_STRING);
$columnName = 'rd_' . $getName;
$artCode = $_SESSION['artcode'];
$getadmrmaid = $_SESSION['getadmrmaid'];
$delRmaDetVal = $dbh->prepare("UPDATE rma_detail LEFT JOIN rma ON rma_detail.rd_rma_id=rma.r_id SET $columnName = NULL WHERE rd_artikel_code = :artcode AND r_nr = :getadmrmaid");
$delRmaDetVal->bindParam(':artcode', $artcode, PDO::PARAM_STR);
$delRmaDetVal->bindParam(':getadmrmaid', $getadmrmaid, PDO::PARAM_INT);
$delRmaDetVal->execute();
?>
- In my mysql table empty is checked for that column
- Default value is NULL.
I have updated the NULL to some value (ie: 2014-12-2) but now i want to put it back to NULL when i click the above button but this is not working. I don't get any error.
$_SESSION['rights']doesn't include the required$accptList, but you don't exit the script or wrap the rest in anelse, so the database code executes even if the header is sent, doesn't it?