Commit 594f1649 authored by Nico Schallehn's avatar Nico Schallehn

test

parent a300deee
...@@ -246,19 +246,19 @@ class Media { ...@@ -246,19 +246,19 @@ class Media {
$update =""; $update ="";
$first = true; $first = true;
$changed = "";
foreach ($newData AS $key=> $value){ foreach ($newData AS $key=> $value){
if(!(md5($Film[$key]) == md5($newData[$key]))) { if(!(md5($Film[$key]) == md5($newData[$key]))) {
$update .= " ".($first?"":",").$key." = '".$value."'"; $update .= " ".($first?"":",").$key." = '".$value."'";
$first = false; $first = false;
$changed .= $key.", ";
} }
} }
if(!$first){ if(!$first){
$SQL = "UPDATE Filme SET".$update." WHERE imdbID = '".$Film["imdbID"]."';"; $SQL = "UPDATE Filme SET".$update." WHERE imdbID = '".$Film["imdbID"]."';";
$counterChange++; $counterChange++;
echo $SQL; echo "Ändere ".$changed.PHP_EOL;
//$mysqli->query($SQL); $mysqli->query($SQL);
file_put_contents("./phpTestout/update.txt", $SQL.PHP_EOL, FILE_APPEND); file_put_contents("./phpTestout/update.txt", $SQL.PHP_EOL, FILE_APPEND);
echo $SQL.PHP_EOL; echo $SQL.PHP_EOL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment