Need some guidance on how to encrypt a new password that has been entered by a user in their profile page.
My PHP for updating the profile page is currently this:
<?php
session_start();
include("connection.php");
$name = $_POST['name'];
$email = $_POST['email'];
$DOB = $_POST['DOB'];
$country = $_POST['country'];
$password = $_POST['password'];
$query = "UPDATE users SET name = '".$name."', email = '".$email."', DOB = '".$DOB."', country = '".$country."', password = '".$password."' WHERE id='".$_SESSION['id']."'";
$result = mysqli_query($link, $query);
header('Location: profile.php');
?>
I used md5 twice for the login but not sure how to implement it here. I'm pretty new to PHP and SQL so I apologize in advance if this is obvious to some folks.
Your help would be greatly appreciated. Thank you.