From 856d5a41db11b10c8353bccaad4362edc1251a72 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Wed, 15 Feb 2023 14:33:20 +0100 Subject: [PATCH] change to SQL --- dataCollector/dataCollector.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dataCollector/dataCollector.php b/dataCollector/dataCollector.php index a4646b6..624111d 100644 --- a/dataCollector/dataCollector.php +++ b/dataCollector/dataCollector.php @@ -29,7 +29,8 @@ if ($conn->connect_error) { function saveToDatabase($contentArray, $conn) { echo "sending Query to Database
"; $sql = "SELECT * FROM `topics` WHERE 1"; - $result = $conn->query($sql); +// $result = $conn->query($sql); + $result = 0; echo "Select Query sent
Result: " . $result; if($result === 0) { $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]."'";