PHP   

Update Db record using PHP and Mysqli

$conn = new mysqli("localhost","root","password","dbname");
if(! $conn ) {
      die('Could not connect to the database ');
}

$userEmail ="[email protected]";

$updateData = "UPDATE users SET user_email ='$userEmail' WHERE username= 'russel'";
if (mysqli_query($conn, $updateData)) {  
	echo "Record updated successfully";
    } 
else {
	echo "Error updating record: " . mysqli_error($conn);
}
Need Professional Support for Your Website Problems?

Whether you're facing website issues or struggling with code implementation, our team is here to assist. Hire us to get your website back on track.

Hire Us