Jak dodać dane sesji do bazy danych MySQL z przycisku

$conn = Connect(); //your MySQLDB connection

// extract values from session to variables
$username= $conn->real_escape_string($_SESSION['auth_user']['username']);
$email= $conn->real_escape_string($_SESSION['auth_user']['email']);
$phone= $conn->real_escape_string($_SESSION['auth_user']['phone']);

//query execution
$query = $conn->prepare("INSERT into loginDetails(username,email,phone) VALUES (?, ?, ?)");
$query->bind_param("sss", $username, $email, $phone); 
$query->execute();
SAMER SAEID