Why my code is not working. Help, I don't see any wrong. If I use user_id=$current_user instead of user_id=:current_id, it works. But I need to prepare for security reason. Help please.
<?php
$hostname = 'localhost';
$username = '**';
$password = '**';
$dbname = '**';
try {
$db = new PDO("mysql:host=$hostname;dbname=$dbname", "$username" ,"$password" ,
array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
} catch (PDOException $e) {
echo" There was an error with the connection";
}
$current_user=$_POST['users_id'];//get user id
include 'db_tag.php';
$stmt=$db->prepare("DELETE FROM object_sign WHERE user_id=:current_id");
$stmt->bindParam(":current_id",$current_user,PDO::PARAM_INT);
$stmt->execute();
?>