I have my codes here, i cant update my database using this codes please help.

 if(isset($_GET['submit'])){

$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_code = $_POST['req_code'];
//$req_code = $_GET['req_code'];
$req_code = $_POST['req_code'];


$sql = "UPDATE request SET req_status='Waiting for Note', req_dateapprove = NOW() WHERE req_code='".$_POST['req_code']."'  LIMIT 1";
//WHERE req_code= '".$_POST['req_code']."' and req_dateapprove = NOW() ";

if ($conn->query($sql) === TRUE) {
    echo "Record updated successfully";
} else {
    echo "Error updating record: " . $conn->error;
}

$conn->close();
}

Your "can't update" means the coonection failed or the db not updated or it always goes into echo "Error updating record: " . $conn->error; even db update?
Any error thrown?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.