Commit 3fcebf68 authored by Luke081515's avatar Luke081515

UpdateBKLTable: prevent call on a non-object

* fetch-assoc gets only called if there results.
parent d651d05c
Pipeline #74 passed with stage
in 41 seconds
......@@ -35,10 +35,12 @@ class BKLLC extends Core {
$sql = 'SELECT DisID FROM Disambig;';
$result = $this->DB->query($sql);
$a = 0;
while ($row = $result->fetch_assoc()){
$AlreadySet[$a] = $row['DisID']; // Ruft alle bestehende Infos ab
$a++;
}
try {
while ($row = $result->fetch_assoc()) {
$AlreadySet[$a] = $row['DisID']; // Ruft alle bestehende Infos ab
$a++;
}
} catch (Exception $e) {}
$result->free();
$ListIDs = unserialize($this->getCatMembers('Kategorie:Begriffsklärung'));
$a=0;
......@@ -47,7 +49,7 @@ class BKLLC extends Core {
if ($a < 200000)
return false; // Fehler in der Abfrage
$a=0;
while (isset ($ListIDs [$a])) {
while(isset($ListIDs[$a])) {
$sql = 'SELECT DisID FROM Disambig WHERE DisID = ' . $ListIDs [$a] . ';';
$result = $this->DB->query($sql);
if ($result === 0) {
......@@ -60,10 +62,12 @@ class BKLLC extends Core {
$sql = 'SELECT DisID FROM Disambig;';
$result = $this->DB->query($sql);
$a = 0;
while ($row = $result->fetch_assoc()){
$AlreadySet[$a] = $row['DisID']; // Ruft alle bestehende Infos ab
$a++;
}
try {
while ($row = $result->fetch_assoc()){
$AlreadySet[$a] = $row['DisID']; // Ruft alle bestehende Infos ab
$a++;
}
} catch (Exception $e) {}
$result->free();
while(isset($AlreadySet[$a])) {
$b=0;
......
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