Add remaining project files (exclude ignored folders)

This commit is contained in:
WD - Dev
2025-07-05 15:11:40 +07:00
parent a96eb2b958
commit b440b80882
4697 changed files with 1365702 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
include "../config/connect.php";
try {
// Ambil data user
$stmt = $pdo->prepare("SELECT id, nama, password FROM user_akses");
$stmt->execute();
while ($data = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo $data['id'] . " " . $data['nama'] . " " . $data['password'] . "<br>";
// Hash password
$hashedPassword = password_hash($data['password'], PASSWORD_DEFAULT);
// Update password yang sudah di-hash
$updateStmt = $pdo->prepare("UPDATE user_akses SET password = :password WHERE id = :id");
$updateStmt->bindParam(':password', $hashedPassword);
$updateStmt->bindParam(':id', $data['id']);
$updateStmt->execute();
}
} catch (PDOException $e) {
// Tangani kesalahan
echo "Terjadi kesalahan: " . $e->getMessage();
}
?>