Reputation: 339
I want to delete data but with multiple condition so I write this:
$STH = $DBH->prepare("DELETE FROM track_aktivnosti WHERE (ID,ajdi), VALUES(:id,:ajdi)");
$STH->bindParam(':id', $_POST['vrednostid']);
$STH->bindParam(':ajdi', $_POST['ajdi']);
but I have error is statement? What do I need to change?
Upvotes: 0
Views: 59
Reputation: 11984
$stmt = $dbh->prepare("DELETE FROM track_aktivnosti WHERE (ID = ? and ajdi = ?)");
$stmt->execute(array($_POST['vrednostid'],$_POST['ajdi']));
Upvotes: 1
Reputation: 1120
your SQL syntax is wrong. It should be
$STH = $DBH->prepare("DELETE FROM track_aktivnosti WHERE ID=:id AND ajdi=:ajdi");
$STH->bindParam(':id', $_POST['vrednostid']);
$STH->bindParam(':ajdi', $_POST['ajdi']);
$STH->execute();
Upvotes: 3