Show alert message after updating record
Hello All,
Please could someone kindly review my code and advice where I am wrong. Below is a code on how to show an alert message after updating a record but it seems not to work. I use similar code for insert and its working well but on Update its not showing any message
Below is the UPDATE code
<?php
if(isset($_POST['submit']))
{
$ass_id=$_POST['ass_id'];
$txpaid=$_POST['txpaid'];
$editedby=$_POST['editedby'];
$dateedited=$_POST['dateedited'];
mysql_select_db ($database_DB,$DB);
$qur="UPDATE tbl_assess SET txpaid='$txpaid', editedby='$editedby', dateedited='$dateedited' WHERE ass_id=$ass_id";
$retval = mysql_query($qur,$CRIRS_DB) or die(mysql_error());
if ($retval == true) {
$result='<div class="alert alert-success">Your assessment was successfully posted</div>';
}else {
$result='<div class="alert alert-danger">Sorry there was an error posting your assessment. Please try again</div>';
}
header('Location: ' . $_SERVER['HTTP_REFERER']);
}
?>
Here is the code above my form that shows the message
<div class="col-sm-10 col-sm-offset-2">
<?php echo $result; ?>
</div>
Your review tips is highly appreciated...
Thank you in anticipation.
Mike
