prepare("SELECT * FROM main.auth"); //weirdly, this requires a schema name $stmt->execute([]); $result = $stmt->fetchAll(PDO::FETCH_DEFAULT); $pr = array(); foreach ($result as $usern) { $pr[$usern['username']] = 1; } for ($i = 0; $i < 10; $i++) { foreach ($result as $usern) { $theuser = $usern['username']; $stmt = $db->prepare("SELECT * FROM main.follow WHERE username = ?"); $stmt->execute([$theuser]); $followers = $stmt->fetchAll(PDO::FETCH_DEFAULT); foreach ($followers as $follown) { if ($usern == $follown['target']) continue; $pr[$usern['username']] += $pr[$follown['target']]; } $h = $pr[$usern['username']]; $pr[$usern['username']] = log($h/10 + 1)*10* M_E; } } foreach ($result as $usern) { ?>
Rank: