What does the syntax of a prepared statement look like?
$id = filter_input(INPUT_POST, “id”, FILTER_SANITIZE_SPECIAL_CHARS); $command=”DELETE FROM polls WHERE ID=?”;
$stmt = $dbh->prepare($command);
$userParams = [$deleteid];
$stmt->execute($userParams);
How does the dbo try catch block look?
Try {
$dbh = new Dbo(....);
} catch ($e) {
die(“Could not connect”);
}How do you check if a prepared statement was properly executed or not?
If (!execute([$1, $2, $3...]){
Echo “error not executed”;
} else {
Echo “execution successful”;
}