From ad99e6260992dc78a9991ed0d0b4d48e792bcd82 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Wed, 15 Feb 2023 14:37:50 +0100 Subject: [PATCH] change to SQL --- dataCollector/dataCollector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataCollector/dataCollector.php b/dataCollector/dataCollector.php index ace3105..7122573 100644 --- a/dataCollector/dataCollector.php +++ b/dataCollector/dataCollector.php @@ -30,8 +30,8 @@ function saveToDatabase($contentArray, $conn) { echo "sending Query to Database
"; $sql1 = "SELECT * FROM `topics` WHERE 1"; $result1 = $conn->query($sql1); - echo "Select Query sent
Result: " . $result1; - if($result1 === 0) { + echo "Select Query sent
"; + if(1 === 1) { $sql = "INSERT INTO `topics` (`id`, `fullJSON`, `timeWatchM`,`timeWatchW`, `timeWatchD`, `countWatchM`, `countWatchW`, `countWatchD`) values ('".$contentArray[0]."', '".$contentArray[2]."', ".$contentArray[3].", ".$contentArray[4].", ".$contentArray[5].", ".$contentArray[6].", ".$contentArray[7].", ".$contentArray[8].") ON DUPLICATE KEY UPDATE `id` = '".$contentArray[0]."'"; $result = $conn->query($sql); echo "Insert Query sent
Result: " . $result;