[phplib] db_pgsql.inc does not close connection to sql-server From: Lars Christensen (lars <email protected>)
Date: 01/11/01

Hi there...

I'm currently using the phpLIB 7.2c, and I'm experiencing the following
problem.

I'¨ve got a webpage, which get it's data from a PostgreSQL DB-server.

To connect to the server, I use the db_pgsql.inc-file from the phpLIB.

Code:

<?php
        $db = new DB_Netstop();
        $sort_by = "date";
        $numresult = $db->query("SELECT * FROM $newstable ORDER BY $sort_by DESC
LIMIT 5");
        while($db->next_record()) {

                $danish_days = array("", "Mandag", "Tirsdag", "Onsdag", "Torsdag",
"Fredag", "Lørdag", "Søndag");
                $danish_months = array("", "januar", "februar", "marts", "april", "maj",
"juni", "juli", "august", "september", "oktober", "november", "december");

                $mm = split("-",$db->f("date"));
                $mm[1] = ereg_replace("^0","",$mm[1]);
                $day = strftime ('%u', mktime(0,0,0,$mm[1],$mm[2],$mm[0]));
                $month = $mm[1];
                echo "<hr noshade size=\"1\">";
?>
                  <p class="dato" align="right">
                  <span class="dato" align="right"><?php echo "$danish_days[$day]
$mm[2]. $danish_months[$month] $mm[0]"; ?></span>
                  <p class="normal"><b><?php echo $db->f("titel"); ?></b><br><?php echo
$db->f("nyhed"); ?></p>
<?php
                $link = $db->f("link");
                if (!empty($link)) { ?>
                        <p class="normal">Yderligere information: <a href="<?php echo "$link";
?>" class="centerlink-intern">kan f&aring; her</a>.</p>
<?php }
}
?>

My problem is, that the script does not close the connection to the SQL-server.
How do I make it do so??

Sincerely

Lars Christensen (from Denmark)

PS. Pardon me the ulgy code... I know... :o))

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>