From 6eb32f2b5bcaf5026efe0dfda7ed90a46e34bb17 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Wed, 15 Feb 2023 14:05:52 +0100 Subject: [PATCH] change to SQL --- dataCollector/dataCollector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataCollector/dataCollector.php b/dataCollector/dataCollector.php index 46725c3..29537ef 100644 --- a/dataCollector/dataCollector.php +++ b/dataCollector/dataCollector.php @@ -29,7 +29,7 @@ if ($conn->connect_error) { function saveToDatabase($contentArray, $conn) { echo "sending Query to Database
"; // $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]"; - $sql = "INSERT INTO `topics` (`id`, `lastSave`, `fullJSON`, `timeWatchM`,`timeWatchW`, `timeWatchD`, `countWatchM`, `countWatchW`, `countWatchD`) values ('test2', 2014, '{}', 10, 10, 10, 10, 40, 10) ON DUPLICATE KEY UPDATE `id` = 'test'"; + $sql = "INSERT INTO `topics` (`id`, `lastSave`, `fullJSON`, `timeWatchM`,`timeWatchW`, `timeWatchD`, `countWatchM`, `countWatchW`, `countWatchD`) values ('test2', 2014, '{}', 15, 10, 10, 10, 40, 10) ON DUPLICATE KEY UPDATE `id` = 'test2'"; $result = $conn->query($sql); echo "Query sent
"; echo $result;