change to SQL
This commit is contained in:
parent
6eb32f2b5b
commit
59eb7aa3ae
|
@ -29,7 +29,7 @@ if ($conn->connect_error) {
|
||||||
function saveToDatabase($contentArray, $conn) {
|
function saveToDatabase($contentArray, $conn) {
|
||||||
echo "sending Query to Database<br>";
|
echo "sending Query to Database<br>";
|
||||||
// $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`, `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, '{}', 15, 10, 10, 10, 40, 10) ON DUPLICATE KEY UPDATE `id` = 'test2'";
|
$sql = "INSERT INTO `topics` (`id`, `lastSave`, `fullJSON`, `timeWatchM`,`timeWatchW`, `timeWatchD`, `countWatchM`, `countWatchW`, `countWatchD`) values ('test', 2014, '{}', 15, 10, 10, 10, 100, 10) ON DUPLICATE KEY UPDATE `id` = 'test'";
|
||||||
$result = $conn->query($sql);
|
$result = $conn->query($sql);
|
||||||
echo "Query sent<br>";
|
echo "Query sent<br>";
|
||||||
echo $result;
|
echo $result;
|
||||||
|
|
Loading…
Reference in New Issue