Re: Re: All executed queries in DB (Common?)
| From: | Charlie van de Kerkhof | Date: | Tue, 18 Apr 2006 11:56:07 +0000 |
| Subject: | Re: Re: All executed queries in DB (Common?) | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23711@lists.php.net to get a copy of this message | ||
On 18 Apr 2006, at 11:57, Mark Wiesemann wrote:
Lukas Smith wrote:Ok. I understand this. But DB_Table gives me error messages 'Trying to get property of non-object'. Here is the initiating code: $dsn = array( 'phptype' => 'mysqli', 'username' => $DBUSER, 'password' => $DBPASS, 'hostspec' => $DBHOST, 'database' => $DBNAME, ); $options = array(to make it clearer .. i assume DB_Table lets you set options for DB and MDB2. it definately allows you to pass an instance to it (in which you can have the options set already).Setting options is not possible because DB_Table expects a DB or MDB2 instance as first constructor param. As Lukas said, instanciating MDB2 with the 'debug_handler' option and passing this object to DB_Table's constructor should be the right way here.
'debug' => 2,'debug_handler' => 'sqlDebugger', 'portability' => MDB2_PORTABILITY_ALL, 'quote_identifier' => true, ); $G_DB =& MDB2::factory($dsn, $options); if (PEAR::isError($G_DB)) {
die ($G_DB->getMessage());} $G_DB->setFetchMode(MDB2_FETCHMODE_ASSOC); And the DB_Table initiating: $oUser =& new User($G_DB, 'user', 'safe'); Should be enough I think? Thanx in advance! - Charlie http://www.pear-forum.org