<html><body>
<?php
require_once 'DB.php';
$dsn = "pgsql://www:n*T76N^&gnHN@localhost/ejpprd";
$options = array(
  'debug'       => 2,
  'portability' => DB_PORTABILITY_ALL,
);
$db = &db::connect($dsn, $options);
if (pear::isError($db)) {
  die($db->getMessage());
}
else {
  $db->setFetchMode(DB_FETCHMODE_ASSOC);
  $st = $db->prepare("select counter_id,hits from blog.counters where hits>=?");
  $rs = &$db->execute($st, array(40));
  if (pear::isError($rs)) {
    die($rs->getMessage());
  }
  else {
    //if ($rs->numRows > 0)
      echo "  <table>\n";
    while ($rs->fetchInto($row)) {
      echo "     <tr><td>".$row['counter_id']."</td><td>".$row['hits']."</td></tr>\n";
    }
    //if ($rs->numRows > 0)
      echo "  </table>\n";
  }
  $db->disconnect();
}
?>
</html></body>
