RE: [PEAR] MDB::setfetchmode()

From: Date: Fri, 02 May 2003 07:58:44 +0000
Subject: RE: [PEAR] MDB::setfetchmode()
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5178@lists.php.net to get a copy of this message
> From: Peter Valicek - Snr. Cluster Engineer [mailto:Peter.Valicek@Sun.COM] > Sent: Friday, May 02, 2003 9:25 AM > if I try to use MDB there is an error, by using setfetchmode. > > Example Code: > /* > * Connections MySQL > */ > require_once 'MDB.php'; > $dsn_mysql = > "mysql://".$myPrefs['username'].":".$myPrefs['password']."@".$myPrefs['h os > tname']."/".$myPrefs['database'].""; > $my = MDB::connect($dsn_mysql,$myPrefs['options']); > $my->setFetchMode(MDB_FETCHMODE_ASSOC); <<<< LINE 19 > > I'll get following error by using this: > Fatal error: Call to undefined function: setfetchmode() in > /var/apache/htdocs/opencall_dev/sbin/dbTrans/dbcons.php on line 19 > > In my Preferences I have: > $myPrefs['options']['persistent'] = "true"; > $myPrefs['options']['optimize'] = "performence"; > $myPrefs['options']['autofree'] = "true"; > > > May someone can tell me why this is not working? You are trying to set an option that does not yet exist in MDB (it will be added in the future). Therefore you are getting an error object instead of a database object. Thy this: $my = MDB::connect($dsn_mysql,$myPrefs['options']); if(MDB::isError($my)) echo $my->getMessage().': '.$mygetUserinfo(); regards, Lukas

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