Thread: Cleanup
View Single Post
  #3  
Old 31st March 2021, 09:56
xblade's Avatar
xblade xblade is offline
Cod3r
 
Join Date: Nov 2020
P2P
Posts: 239
Default
thank you for your post with help on this one the code works very good on Debian 8 MyISAM ive moved to Debian 9.4 MyISAM its only on this i get errors on clean up......and its just one torrent from seedbox and also mate on a home pc its the same on both ends....Every 15 min on clean up we get this.
it shows seeding in seedbox and mate home pc its like its ghosting if you know what i mean...ram ok over 2 GIGS...PHP version: 7.0.33 ...also i took this for a test run on
xampp work ok on pc nps at all
Done test of clean up it is this part of the clean up

Code:
    $fields = explode(":", "comments:leechers:seeders");
    $res = sql_query("SELECT id, seeders, leechers, comments FROM torrents");
    while ($row = mysqli_fetch_assoc($res)) {
        $id = $row["id"];
        $torr = $torrents[$id];
        foreach ($fields as $field) {
            if (!isset($torr[$field]))
                $torr[$field] = 0;
        }
        $update = array();
        foreach ($fields as $field) {
            if ($torr[$field] != $row[$field])
                $update[] = "$field = " . $torr[$field];
        }
        if (count($update))
            sql_query("UPDATE torrents SET " . implode(",", $update) . " WHERE id = $id");
    }
that is causeing the probs

Last edited by xblade; 31st March 2021 at 10:16.
Reply With Quote