i have my codes here, something wrong on my codes, it cant update my table status and req_acknowledge? someone help me. this is what my system run, when i click the button "close" my table status will update to "closed-acknowledged" and when the status is equal to feedback available" and if not, nothing change to the status..
<?php
if(isset($_POST['try'])){
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "elev8groupportal";
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$req_status = mysqli_real_escape_string($conn, $_POST['req_status']);
$sql = "UPDATE request SET req_status='Closed-Acknowledgement', req_acknowledge=NOW() WHERE req_code = '".$_POST['req_code201']."' and req_status= 'Feedback Available'"or die (mysql_error()
);
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$conn->close();
}
?>
<form>
Company: <input type="text" value="<?php echo ($dn1['comp_name']); ?>" size="50" readonly></input><br><br>
Type of Request: <input type="text" value="<?php echo ($dn1['itrf_type']); ?>" size="50" readonly><br><br>
Date Needed: <input type="text" value="<?php echo ($dn1['req_dateneeded']); ?>" size="50" readonly></input><br><br>
Project Details: <textarea name="textarea" rows="2" value="" cols="50" readonly><?php echo ($dn1['itrf_details']); ?></textarea><br><br>
FORM STATUS: <input type="" value="<?php echo ($dn1['req_status']); ?>" size="50" readonly></input><br><br>
_________________________________________________________________________________________________________________
<label> Approver Comment:</label><br>
<i><textarea rows="3" cols="50" width="100px" id="noter_comment" name="noter_comment" align="right" readonly><?php echo ($dn1['app_comment']); ?></textarea><br /></i>
<label> Noter Comment</label><br>
<i><textarea rows="3" cols="50" width="100px" id="noter_comment" name="noter_comment" align="right" readonly><?php echo ($dn1['noter_comment']); ?></textarea><br /></i>
<label>Request Feedback</label><br>
<textarea rows="3" cols="50" width="100px" id="TRF_comment" name="TRF_comment" align="right" readonly><?php echo ($dn1['TRF_comment']); ?></textarea><br /><br />
<button type="submit" class="btn btn-primary" name="try" id="try" >Close Form</button>
</form>
</div>
</div>