You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
753 B
PHP
22 lines
753 B
PHP
<?php
|
|
|
|
include('config.inc.php');
|
|
|
|
$db = new PDO('mysql:host=' . $config['host'] . ';dbname=' . $config['database'], $config['dbuser'], $config['password'], [
|
|
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
|
|
\PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8mb4'"
|
|
]);
|
|
// $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE , PDO::FETCH_ASSOC );
|
|
|
|
$result = array('res' => 0, 'data' => array());
|
|
|
|
$term_id = isset($_GET['term_id']) ? intval($_GET['term_id']) : 0;
|
|
$cmdid = isset($_GET['cmdid']) ? $_GET['cmdid'] : '';
|
|
|
|
$stmt = $db->prepare("DELETE FROM terminal_photos WHERE term_id=?");
|
|
$stmt->bindValue(1 , $term_id);
|
|
$stmt->execute();
|
|
|
|
header ('Content-type: application/json; charset=utf-8');
|
|
echo json_encode($result, JSON_UNESCAPED_UNICODE);
|