<?php
require_once __DIR__ . '/connection.php';
$img_id = $_POST['img_id'];
$img_path = $_POST['img_path'];
$type = $_POST['type'];
$user = $_POST['user'];
$sessionID = $_POST['sessionID'];
$data = array(); // array to pass back data
$check = $dbConnect->prepare('DELETE FROM drucker
WHERE img_id = :img_id
AND img_path = :img_path
AND type = :type
AND user = :user
AND sessionID = :sessionID');
$check->bindValue(':img_id', $img_id);
$check->bindValue(':img_path', $img_path);
$check->bindValue(':type', $type);
$check->bindValue(':user', $user);
$check->bindValue(':sessionID', $sessionID);
//$check->execute();
if ($check->execute() === true) {
$data['success'] = true;
} else {
$data['success'] = false;
}
// return all our data to an AJAX call
echo json_encode($data);