|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-05-20 11:24 UTC] klaus at capitalfocus dot org
Description: ------------ Package download statistics does not agree with graph. See this example: http://pear.php.net/package-stats.php?cid=10&pid=233&rid=1401 Have no idea what's going on there. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 15:00:01 2025 UTC |
This probably has to do with the package_stats and downloads tables being out of synch. Below is a script that can get them in line. Martin will have the various permissions needed to run it, so I'm foisting this off onto him. <?php require_once 'DB.php'; $db =& DB::connect('mysql://pear:pear@localhost/pear'); $db->setFetchMode(DB_FETCHMODE_ASSOC); $db->query('lock tables downloads write, package_stats write'); $res =& $db->query('select release, count(*) as quant from downloads group by release'); while ($res->fetchInto($row)) { echo implode(' ', $row) . "<br />\n"; $db->query('update package_stats set dl_number = ' . $row['quant'] . ' where rid = ' . $row['release']); } $db->query('unlock tables'); ?>