change to SQL

This commit is contained in:
schrom01 2023-02-15 17:00:11 +01:00
parent 5c8dcb4ca4
commit 8e2e2ecb61
1 changed files with 4 additions and 2 deletions

View File

@ -55,9 +55,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
echo "POST Request received.<br>"; echo "POST Request received.<br>";
if(property_exists($entityBodyObject, "id")) { if(property_exists($entityBodyObject, "id")) {
if(! ($entityBodyObject->countWatchM + $entityBodyObject->countWatchW + $entityBodyObject->countWatchD === 0)){
saveToDatabase(objectToArray($entityBodyObject, $entityBody), $conn); saveToDatabase(objectToArray($entityBodyObject, $entityBody), $conn);
echo "<br>Data saved.<br>"; echo "<br>Data saved.<br>";
} }
}
} elseif($_SERVER['REQUEST_METHOD'] === 'GET') { } elseif($_SERVER['REQUEST_METHOD'] === 'GET') {
download_xlsxFile(getFromDatabase()); download_xlsxFile(getFromDatabase());
} else { } else {