From 973e5da155f1b90c8bfdd31c00ba1841cc19af40 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Wed, 15 Feb 2023 13:50:12 +0100 Subject: [PATCH] change to SQL --- dataCollector/dataCollector.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dataCollector/dataCollector.php b/dataCollector/dataCollector.php index 7ad6d17..aa44a5d 100644 --- a/dataCollector/dataCollector.php +++ b/dataCollector/dataCollector.php @@ -23,13 +23,15 @@ if (!$link) { die('Could not connect to Database: ' . mysql_error()); } //if connection is successfully you will see message below -echo 'Connected successfully to Database'; +echo 'Connected successfully to Database
'; mysqli_close($link); //$mysqli = new mysqli($databaseAddress, $databaseUser, $databasePassword, $databaseName); function saveToDatabase($contentArray, $mysqli) { + echo "sending Query to Database
"; $response = mysqli_query($mysqli, "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]"); + echo "Query sent
"; echo $response; return $response; }