change to SQL
This commit is contained in:
parent
cc604420f3
commit
4d50ad03bf
|
@ -24,11 +24,11 @@ $mysqli = new mysqli($databaseAddress, $databaseUser, $databasePassword, $databa
|
|||
$mysqli = new mysqli($databaseAddress, $databaseUser, $databasePassword, $databaseName);
|
||||
|
||||
function saveToDatabase($contentArray, $mysqli) {
|
||||
$mysqli->query("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]");
|
||||
return $mysqli->query("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]");
|
||||
}
|
||||
|
||||
function getFromDatabase() {
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
$entityBody = '{"lastSave": 0, "timeWatchM": 0, "timeWatchW": 0, "timeWatchD": 0, "countWatchM": 0, "countWatchW": 0, "countWatchD": 0, "id":"test","watches":[{"actions":[]},{"actions":[]},{"actions":[]}]}';
|
||||
|
|
Loading…
Reference in New Issue