cvs: php-master-web /fetch stats.php /include functions.inc
| From: | jim winstead | Date: | Mon, 13 May 2002 02:41:25 +0000 |
| Subject: | cvs: php-master-web /fetch stats.php /include functions.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-10134@lists.php.net to get a copy of this message | ||
jimw Sun May 12 22:41:25 2002 EDT
Added files:
/php-master-web/fetch stats.php
Modified files:
/php-master-web/include functions.inc
Log:
some basic stats from the database
Index: php-master-web/include/functions.inc
diff -u php-master-web/include/functions.inc:1.4 php-master-web/include/functions.inc:1.5
--- php-master-web/include/functions.inc:1.4 Mon Mar 4 13:39:51 2002
+++ php-master-web/include/functions.inc Sun May 12 22:41:25 2002
@@ -16,6 +16,14 @@
return $res;
}
+function mysql_get_one($query) {
+ $res = mysql_query($query);
+ if ($res && mysql_num_rows($res)) {
+ return mysql_result($res,0);
+ }
+ return false;
+}
+
function head($title="") {?>
<html>
<head>
Index: php-master-web/fetch/stats.php
+++ php-master-web/fetch/stats.php
<?php
require 'functions.inc';
# token required, since this should only get accessed from rsync.php.net
if (!isset($token) || md5($token) != "19a3ec370affe2d899755f005e5cd90e")
die("token not correct.");
// Connect and generate the list from the DB
if (@mysql_pconnect("localhost","nobody","")) {
echo 'notes ', mysql_get_one("SELECT COUNT(*) FROM php3.note"),
"\n";
echo 'hosts ', mysql_get_one("SELECT COUNT(*) FROM phphosts.hosts"),
"\n";
echo 'bugs ', mysql_get_one("SELECT COUNT(*) FROM php3.bugdb"),
"\n";
echo 'openbugs ', mysql_get_one("SELECT COUNT(*) FROM php3.bugdb WHERE
status='Open' OR status='Assigned' OR status='Analyzed' OR
status='Critical'"), "\n";
}