change to SQL
This commit is contained in:
parent
0e5864370f
commit
973e5da155
|
@ -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<br>';
|
||||
|
||||
mysqli_close($link);
|
||||
//$mysqli = new mysqli($databaseAddress, $databaseUser, $databasePassword, $databaseName);
|
||||
|
||||
function saveToDatabase($contentArray, $mysqli) {
|
||||
echo "sending Query to Database<br>";
|
||||
$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<br>";
|
||||
echo $response;
|
||||
return $response;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue