Hi here's my code I created the 2 sqlite table sample and login_info properly though this error still pops up
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 25 bind or column index out of range in C:\xampp\htdocs\display.php:22
<?php
session_start();
$user = $_POST['username'] ?? '';
$pword = $_POST['password'] ?? '';
$_SESSION['details'] = [
'user' => $user,
'pword'=> $pword
];
$pdo = new PDO('sqlite:'.__DIR__.'/users.db');
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
if (!isset($_SESSION['sample'])){
$statement = $pdo->prepare("INSERT INTO sample(timecreated) VALUES (?)");
$statement->execute([time()]);
$_SESSION['sample'] = $pdo->lastInsertId();
}
$deleteStatement = $pdo->prepare("DELETE FROM login_info WHERE employee_id=?");
$deleteStatement->execute([$_SESSION['sample']]);
This is where my error starts
$insertStatement = $pdo->prepare("INSERT INTO login_info (username,password) VALUES (?,?)");
$insertStatement->execute([$_SESSION['sample'],'username', $user]);
$insertStatement->execute([$_SESSION['sample'],'password', $pword]);
?>
<!DOCTYPE html>
<html>
<head>
<title>Display</title>
</head>
<body>
<p>
Your username is <?php echo $user ?> and your password <?php echo $pword ?>.
</p>
<a href="login.php">Go Back</a>
</body>
</html>'