Re: PEAR and MDB2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# raf.news@xxxxxxxxx / 2006-11-11 12:02:37 +0100:
> require_once 'Pear/MDB2.php';
> $dsn = 'pgsql://login:pwd@dbname';
> 
> $mdb2 =& MDB2::connect($dsn);
> if (PEAR::isError($mdb2))
> {
> die($mdb2->getMessage());
> }
> 
> $res =& $mdb2->query('SELECT * FROM articles');

if (PEAR::isError($res))
{
die($res->getMessage());
}

> while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))
> {
> echo $row['title'] . ', ' . $row['content'] . "\n";
> }
> $res->free();

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux