From 8e2e2ecb61e665d6c0cf9af4bd5203e8c406d99b Mon Sep 17 00:00:00 2001 From: schrom01 Date: Wed, 15 Feb 2023 17:00:11 +0100 Subject: [PATCH] change to SQL --- dataCollector/dataCollector.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dataCollector/dataCollector.php b/dataCollector/dataCollector.php index b26f7aa..9b8a6ec 100644 --- a/dataCollector/dataCollector.php +++ b/dataCollector/dataCollector.php @@ -55,8 +55,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { echo "POST Request received.
"; if(property_exists($entityBodyObject, "id")) { - saveToDatabase(objectToArray($entityBodyObject, $entityBody), $conn); - echo "
Data saved.
"; + if(! ($entityBodyObject->countWatchM + $entityBodyObject->countWatchW + $entityBodyObject->countWatchD === 0)){ + saveToDatabase(objectToArray($entityBodyObject, $entityBody), $conn); + echo "
Data saved.
"; + } } } elseif($_SERVER['REQUEST_METHOD'] === 'GET') { download_xlsxFile(getFromDatabase());