Re: DSN hostspec problem

From: Date: Sat, 17 Apr 2004 21:03:36 +0000
Subject: Re: DSN hostspec problem
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11934@lists.php.net to get a copy of this message
On Fri, 2004-04-16 at 22:14, Roger Spears wrote: > Hello, ... > $dsn = "$db_type://$user:$pass@db.someServer.com"; > $db = DB::connect($dsn); > if (DB::isError($db)) > { > $db->disconnect(); // this line contains error according to logs > Hello, Roger First of all, don't call $db->disconnect() on error, because the $db is a PEAR_Error and does not have the disconnect method. Please see http://pear.php.net/manual/en/package.database.db.intro-connect.php for the recommended way to handle an error. Second of all, there should be a database part in the DSN. You can find a complete documentation of it here : http://pear.php.net/manual/en/package.database.db.intro-dsn.php Robert -- Robert Munteanu <rombertworf@xnet.ro> ------------------------------------------------------- Connex scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus. Connex automatically scans all messages for viruses using RAV AntiVirus. Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor. Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat de virusi. Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants. Please be aware that there is a risk involved whenever opening e-mail attachments to your computer and that MobiFon is not responsible for any damages caused by viruses.

« previous php.pear.general (#11934) next »