Re: PEAR and MDB2

From: Date: Sun, 12 Nov 2006 08:46:34 +0000
Subject: Re: PEAR and MDB2
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-244513@lists.php.net to get a copy of this message
so when i have this code :
$options = array('debug'       => 2,
                                           'portability' =>
MDB2_PORTABILITY_ALL,
                                       );
$query = 'SELECT * from sp_u_001(\'all\')'; $db2 = & new MDB2_Driver_pgsql(); $db2->connect($dsn); if (PEAR::isError($db2)) {
       die("Error connection : ".$db2->getMessage());
} $res = $db2->exec($query); if (PEAR::isError($res)) {
       die("Error connection : ".$res->getMessage());
} i get this error ==> "Error connection : MDB2 Error: unknown error" (from $res control) Alain On 11/11/06, Roman Neuhauser <neuhauser@sigpipe.cz> wrote:
# raf.news@gmail.com / 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


« previous php.general (#244513) next »