<?php
// Include the database connection
include 'db_connect.php';

// The password we want to set
$password = 'admin123';

// Generate a valid security hash
$hash = password_hash($password, PASSWORD_DEFAULT);

// Update the database
$sql = "UPDATE admins SET password_hash='$hash' WHERE username='admin'";

if ($conn->query($sql) === TRUE) {
    echo "<h1>Success!</h1>";
    echo "<p>Password for user <b>admin</b> has been reset to: <b>admin123</b></p>";
    echo "<p><a href='admin/login.php'>Click here to Login</a></p>";
} else {
    echo "Error updating record: " . $conn->error;
}
?>