cvs: pearweb /public_html packages.php
| From: | Stig Bakken | Date: | Wed, 09 May 2001 18:30:29 +0000 |
| Subject: | cvs: pearweb /public_html packages.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-125@lists.php.net to get a copy of this message | ||
ssb Wed May 9 11:30:29 2001 EDT
Modified files:
/pearweb/public_html packages.php
Log:
* optimized away N queries in the package browser where N is the
number of packages at the current level. duh.
Index: pearweb/public_html/packages.php
diff -u pearweb/public_html/packages.php:1.5 pearweb/public_html/packages.php:1.6
--- pearweb/public_html/packages.php:1.5 Wed Apr 18 17:57:04 2001
+++ pearweb/public_html/packages.php Wed May 9 11:30:29 2001
@@ -37,8 +37,8 @@
extract($row);
if ($leftvisit && $rightvisit) {
$lv = $leftvisit + 1;
- $num = $dbh->getOne("SELECT COUNT(name) FROM packages WHERE leftvisit".
- " BETWEEN $lv AND $rightvisit");
+ $num = ($rightvisit - $leftvisit - 1) / 2;
+ //$num = $dbh->getOne("SELECT COUNT(name) FROM packages WHERE leftvisit BETWEEN $lv
AND $rightvisit");
} else {
$num = 0;
}