parent
030fd510c6
commit
38480b83a7
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
header("Content-Type:application/json");
|
||||
|
||||
$host="your.sql.server";
|
||||
$user="dbusername";
|
||||
$password="dbpassword";
|
||||
$host="srv-sql.kmpr.local";
|
||||
$user="duplicates";
|
||||
$password="2rqyc\$Tnl0m00l4h";
|
||||
$database="image_duplicates";
|
||||
$table="possible_duplicates";
|
||||
|
||||
|
@ -92,6 +92,14 @@ if (isset($_GET['insertDuplicate'])) {
|
|||
} else {
|
||||
response(903, "Error: You have to provide 'duplicateId' to mark a file pair as duplicate!");
|
||||
}
|
||||
} else if(isset($_GET['totalDuplicates'])) {
|
||||
try {
|
||||
$res = $db->query("SELECT COUNT(id) AS totalDuplicates FROM possible_duplicates WHERE id NOT IN (SELECT pd_id FROM no_duplicates);")->fetchAll(PDO::FETCH_ASSOC);
|
||||
response(200, "Database query successful.", $res);
|
||||
} catch (PDOException $e) {
|
||||
response(999, "Database Error: " . $e->getMessage());
|
||||
die();
|
||||
}
|
||||
} else {
|
||||
response(400, "Error: Invalid Request");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue