cvs: pearweb /include pear-database.php
| From: | Greg Beaver | Date: | Wed, 18 Oct 2006 18:17:35 +0000 |
| Subject: | cvs: pearweb /include pear-database.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-5100@lists.php.net to get a copy of this message | ||
cellog Wed Oct 18 18:17:35 2006 UTC
Modified files:
/pearweb/include pear-database.php
Log:
MySQL 4.0 doesn't support DATEDIFF
This fixes the attractive \"DB Error\" on our current front page
http://cvs.php.net/viewvc.cgi/pearweb/include/pear-database.php?r1=1.317&r2=1.318&diff_format=u
Index: pearweb/include/pear-database.php
diff -u pearweb/include/pear-database.php:1.317 pearweb/include/pear-database.php:1.318
--- pearweb/include/pear-database.php:1.317 Wed Oct 18 17:23:17 2006
+++ pearweb/include/pear-database.php Wed Oct 18 18:17:35 2006
@@ -18,7 +18,7 @@
| Martin Jansen <mj@php.net> |
| Gregory Beaver <cellog@php.net> |
+----------------------------------------------------------------------+
- $Id: pear-database.php,v 1.317 2006/10/18 17:23:17 cellog Exp $
+ $Id: pear-database.php,v 1.318 2006/10/18 18:17:35 cellog Exp $
*/
require_once 'DB/storage.php';
@@ -1565,7 +1565,8 @@
$sth = $dbh->limitQuery('
SELECT
packages.name, releases.version,
- SUM(downloads)/DATEDIFF(NOW(),MAX(releases.releasedate)) as d
+ SUM(downloads)/
+ ((unix_timestamp(NOW()) - unix_timestamp(MAX(releases.releasedate))/86400) as d
FROM releases, packages, aggregated_package_stats a
WHERE
packages.id = releases.package AND