<?php
require 'database.php';
$id = 0;
if ( !empty($_GET['user_id'])) {
$id = $_REQUEST['user_id'];
}
if ( !empty($_POST)) {
// keep track post values
$id = $_POST['user_id'];
// delete data
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "DELETE FROM admin WHERE id = ?"; ===> Wrong on here.. //LINE18
$q = $pdo->prepare($sql);
$q->execute(array($id));
Database::disconnect();
header("Location: index.php");
}
?>
somebody can help me? why i got Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]
sorry my english is bad, thanks